diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 18f482d..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/plot) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index 356e55b..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/plot) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index dc9a1d1..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '42 6 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" - fi - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n - - diff --git a/base/ctor/lib/view/electron/index.js b/base/ctor/lib/view/electron/index.js deleted file mode 100644 index 380ca26..0000000 --- a/base/ctor/lib/view/electron/index.js +++ /dev/null @@ -1,149 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: refactor. Remove disposable server. Create a server in the electron process and have it serve assets from local directories. Should be similar to SimpleServer. - -// MODULES // - -var spawn = require( 'child_process' ).spawn; -var path = require( 'path' ); -var logger = require( 'debug' ); -var toHTML = require( 'vdom-to-html' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var ENV = require( '@stdlib/process/env' ); -var copy = require( '@stdlib/utils/copy' ); -var merge = require( '@stdlib/utils/merge' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var httpServer = require( '@stdlib/net/disposable-http-server' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var debug = logger( 'plot:base:view:electron:main' ); -var electron = tryRequire( '@stdlib/electron' ); - - -// MAIN // - -/** -* Opens a plot in an electron window. -* -* @private -* @param {Plot} plot - plot context -* @param {VTree} vtree - virtual tree -* @throws {Error} Electron must be properly installed -*/ -function view( plot, vtree ) { - var index; - var html; - var opts; - var css; - - if ( instanceOf( electron, Error ) ) { - throw new Error( 'invalid operation. Unable to load Electron. Ensure Electron is installed and try again.' ); - } - debug( 'Transforming virtual DOM tree to HTML...' ); - html = toHTML( vtree ); - - // Define `fs` options: - opts = { - 'encoding': 'utf8' - }; - - debug( 'Injecting HTML into HTML template...' ); - index = path.join( __dirname, 'index.html' ); - index = readFileSync( index, opts ); - index = index.replace( /\{\{plot\}\}/, html ); - - debug( 'Injecting CSS into HTML template...' ); - css = path.join( __dirname, 'css', 'reset.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{reset\}\}/, css ); - - css = path.join( __dirname, 'css', 'colors.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{colors\}\}/, css ); - - css = path.join( __dirname, 'css', 'styles.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{styles\}\}/, css ); - - debug( 'Creating a disposable HTTP server...' ); - opts = { - 'html': index, - 'open': false - }; - httpServer( opts, onReady ); - - /** - * Callback invoked once a server is ready to receive requests. - * - * @private - * @param {(Error|null)} error - error object - * @param {Server} server - HTTP server - * @throws {Error} unexpected error - */ - function onReady( error, server ) { - var child; - var addr; - var opts; - var env; - if ( error ) { - throw error; - } - addr = server.address(); - debug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port ); - - debug( 'Electron executable: %s.', electron ); - - // TODO: extract fixed env vars to config file and then won't need to pass via environment variables, but can simply require - env = { - 'SERVER_PORT': addr.port, - 'SERVER_ADDRESS': addr.address, - 'PLOT_WIDTH': plot.width, - 'PLOT_HEIGHT': plot.height, - 'PLOT_APP_PATH': __dirname, - 'PLOT_MIN_WIDTH': 100, - 'PLOT_MIN_HEIGHT': 100, - 'PLOT_TITLE': plot.title || 'stdlib' - }; - debug( 'Electron process environment variables: %s.', JSON.stringify( env ) ); - - opts = { - 'cwd': __dirname, - 'detached': true, - 'stdio': 'ignore' - }; - debug( 'Electron process options: %s.', JSON.stringify( opts ) ); - - // Merge the current process' environment variables: - opts.env = merge( {}, copy( ENV ), env ); - - debug( 'Spawning an electron process...' ); - child = spawn( electron, [ './main.js' ], opts ); - child.unref(); - } -} - - -// EXPORTS // - -module.exports = view; diff --git a/base/ctor/lib/view/electron/js/debug.js b/base/ctor/lib/view/electron/js/debug.js deleted file mode 100644 index d736a98..0000000 --- a/base/ctor/lib/view/electron/js/debug.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 ENV = require( '@stdlib/process/env' ); - - -// MAIN // - -var debug; - -// Setting the local storage variable must be done BEFORE loading `debug`: -localStorage.debug = ENV.DEBUG; - -// Load `debug`: -debug = require( 'debug/browser' ); // eslint-disable-line stdlib/require-order - - -// EXPORTS // - -module.exports = debug; diff --git a/base/ctor/lib/view/electron/js/script.js b/base/ctor/lib/view/electron/js/script.js deleted file mode 100644 index 39a44c2..0000000 --- a/base/ctor/lib/view/electron/js/script.js +++ /dev/null @@ -1,80 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 path = require( 'path' ); -var readDir = require( '@stdlib/fs/read-dir' ); -var extname = require( '@stdlib/utils/extname' ); -var ENV = require( '@stdlib/process/env' ); -var logger = require( './debug.js' ); - - -// VARIABLES // - -var DIR = path.join( ENV.PLOT_APP_PATH, 'css' ); -var debug = logger( 'plot:base:view:electron:script' ); - - -// FUNCTIONS // - -/** -* Inserts stylesheets. -* -* @private -*/ -function stylesheets() { - var files; - var link; - var i; - - debug( 'Stylesheet directory: %s.', DIR ); - files = readDir.sync( DIR ); - for ( i = 0; i < files.length; i++ ) { - if ( extname( files[i] ) !== '.css' ) { - continue; - } - debug( 'Found a CSS file: %s.', files[i] ); - - debug( 'Generating link element...' ); - link = document.createElement( 'link' ); - link.setAttribute( 'rel', 'stylesheet' ); - link.setAttribute( 'href', path.join( DIR, files[i] ) ); - - debug( 'Appending link element to the document head...' ); - document.head.appendChild( link ); - } -} - - -// MAIN // - -/** -* Main script. -* -* @private -*/ -function main() { - debug( 'Injecting stylesheets into the document...' ); - stylesheets(); -} - -debug( 'Running main script...' ); -main(); diff --git a/base/ctor/lib/view/electron/main.js b/base/ctor/lib/view/electron/main.js deleted file mode 100644 index a7f1136..0000000 --- a/base/ctor/lib/view/electron/main.js +++ /dev/null @@ -1,103 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var app = require( 'electron' ).app; -var BrowserWindow = require( 'electron' ).BrowserWindow; -var ENV = require( '@stdlib/process/env' ); - - -// VARIABLES // - -var debug = logger( 'plot:base:view:electron:main-process' ); -var mainWindow = null; - - -// FUNCTIONS // - -/** -* Creates a browser window. -* -* @private -*/ -function createWindow() { - var opts; - var url; - - opts = { - 'width': parseInt( ENV.PLOT_WIDTH, 10 ) + 80, - 'height': parseInt( ENV.PLOT_HEIGHT, 10 ) + 20, - 'title': ENV.PLOT_TITLE, - - // 'minWidth': parseInt( ENV.PLOT_MIN_WIDTH, 10 ), // TODO: needed? - - // 'minHeight': parseInt( ENV.PLOT_MIN_HEIGHT, 10 ), // TODO: needed? - - // 'titleBarStyle': 'hidden-inset', // hide title bar on OS X - - 'useContentSize': true // specify web page size only considering the content - }; - debug( 'Creating a new browser window configured with the following options: %s.', JSON.stringify( opts ) ); - mainWindow = new BrowserWindow( opts ); - - mainWindow.on( 'close', onClose ); - - url = 'http://'+ENV.SERVER_ADDRESS+':'+ENV.SERVER_PORT+'/index.html'; - debug( 'Loading %s.', url ); - mainWindow.loadURL( url ); -} - -/** -* Callback invoked once a window closes. -* -* @private -*/ -function onClose() { - debug( 'Window closed. Dereferencing window object to allow for GC...' ); - mainWindow = null; -} - -/** -* Quits the application. -* -* @private -*/ -function quit() { - debug( 'Quitting application...' ); - app.quit(); -} - - -// MAIN // - -/** -* Runs the application. -* -* @private -*/ -function main() { - app.on( 'ready', createWindow ); - app.on( 'window-all-closed', quit ); -} - -debug( 'Running application...' ); -main(); diff --git a/base/ctor/lib/view/index.js b/base/ctor/lib/view/index.js deleted file mode 100644 index 36affde..0000000 --- a/base/ctor/lib/view/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var createView = require( './view.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:base:view' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {string} viewer - plot viewer -*/ -function view( viewer ) { - /* eslint-disable no-invalid-this */ - var tmp = this.viewer; - if ( arguments.length ) { - // Temporarily set the viewer: - this.viewer = viewer; - } - debug( 'Viewer: %s.', this.viewer ); - debug( 'Generating view...' ); - createView( this, this.viewer, this.render() ); - if ( arguments.length ) { - // Restore the viewer: - this.viewer = tmp; - } -} - - -// EXPORTS // - -module.exports = view; diff --git a/base/ctor/lib/view/stdout/index.js b/base/ctor/lib/view/stdout/index.js deleted file mode 100644 index be39926..0000000 --- a/base/ctor/lib/view/stdout/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Writes a plot (rendered as a virtual DOM tree) to `stdout`. -* -* @private -* @param {VTree} plot - virtual tree -*/ -function view( plot ) { - console.log( JSON.stringify( plot ) ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/base/ctor/lib/view/view.browser.js b/base/ctor/lib/view/view.browser.js deleted file mode 100644 index 91e2b35..0000000 --- a/base/ctor/lib/view/view.browser.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 stdout = require( './stdout' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {Plot} plot - plot context -* @param {string} viewer - plot viewer -* @param {VTree} vtree - virtual tree -* @throws {Error} must specify a supported viewer -* @returns {void} -*/ -function view( plot, viewer, vtree ) { - if ( viewer === 'none' ) { - return; - } - if ( viewer === 'stdout' ) { - return stdout( vtree ); - } - if ( viewer === 'browser' ) { - throw new Error( format( 'invalid argument. Must provide a supported viewer. Value: `%s`.', viewer ) ); - } - if ( viewer === 'terminal' ) { - // TODO: ASCII - return; - } - throw new Error( format( 'invalid argument. Must provide a supported viewer. Value: `%s`.', viewer ) ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/base/ctor/lib/view/view.js b/base/ctor/lib/view/view.js deleted file mode 100644 index 362970e..0000000 --- a/base/ctor/lib/view/view.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 stdout = require( './stdout' ); -var browser = require( './browser' ); -var electron = require( './electron' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {Plot} plot - plot context -* @param {string} viewer - plot viewer -* @param {VTree} vtree - virtual -* @returns {void} -*/ -function view( plot, viewer, vtree ) { - if ( viewer === 'none' ) { - return; - } - if ( viewer === 'stdout' ) { - return stdout( vtree ); - } - if ( viewer === 'browser' ) { - return browser( vtree ); - } - if ( viewer === 'terminal' ) { - // TODO: ASCII - return; - } - // viewer === 'window' - electron( plot, vtree ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/base/ctor/package.json b/base/ctor/package.json deleted file mode 100644 index 00a2c39..0000000 --- a/base/ctor/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/plot/base/ctor", - "version": "0.0.0", - "description": "Base 2-dimensional plot 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", - "browser": { - "./lib/view/view.js": "./lib/view/view.browser.js" - }, - "directories": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "base", - "constructor", - "ctor", - "figure", - "fig", - "graph", - "chart", - "diagram", - "2-dimensional", - "2d", - "data", - "visualize", - "visualization", - "dataviz", - "explore", - "exploratory", - "analysis" - ] -} diff --git a/branches.md b/branches.md deleted file mode 100644 index 54622ae..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/plot" -%% click B href "https://github.com/stdlib-js/plot/tree/main" -%% click C href "https://github.com/stdlib-js/plot/tree/production" -%% click D href "https://github.com/stdlib-js/plot/tree/esm" -%% click E href "https://github.com/stdlib-js/plot/tree/deno" -%% click F href "https://github.com/stdlib-js/plot/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/plot -[production-url]: https://github.com/stdlib-js/plot/tree/production -[deno-url]: https://github.com/stdlib-js/plot/tree/deno -[deno-readme]: https://github.com/stdlib-js/plot/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/plot/tree/umd -[umd-readme]: https://github.com/stdlib-js/plot/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/plot/tree/esm -[esm-readme]: https://github.com/stdlib-js/plot/blob/esm/README.md \ No newline at end of file diff --git a/components/svg/annotations/README.md b/components/svg/annotations/README.md deleted file mode 100644 index 5db95da..0000000 --- a/components/svg/annotations/README.md +++ /dev/null @@ -1,198 +0,0 @@ - - -# Annotations - -> [SVG][svg] plot annotations. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var Annotations = require( '@stdlib/plot/components/svg/annotations' ); -``` - -#### Annotations() - -Returns an `Annotations` instance. - -```javascript -var node = new Annotations(); -// returns -``` - -* * * - -### Methods - - - -#### Annotations.prototype.render() - -Renders an instance as a [Virtual DOM tree][virtual-dom]. - -```javascript -var node = new Annotations(); - -var vtree = node.render(); -/* e.g., returns - { - 'tagName': 'g', - 'properties': { - 'property': 'annotations', - 'className': 'annotations', - 'attributes': { - 'transform': 'translate(0,0)' - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } -*/ -``` - -* * * - -### Events - - - -#### 'render' - -Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. - -```javascript -var node = new Annotations(); - -function onRender( vtree ) { - console.log( vtree ); -} - -node.on( 'render', onRender ); -node.render(); -``` - -* * * - -### Listeners - - - -#### 'change' - -Upon receiving a `'change'` event, an instance re-renders. - -```javascript -var node = new Annotations(); - -function onRender( vtree ) { - console.log( vtree ); -} - -node.on( 'render', onRender ); -node.emit( 'change' ); -``` - -
- - - - - -
- -
- - - - - -* * * - -
- -## Examples - - - -```javascript -var toHTML = require( 'vdom-to-html' ); -var annotations = require( '@stdlib/plot/components/svg/annotations' ); - -// Create a new component: -var node = annotations(); - -// Render as a virtual DOM tree: -var vtree = node.render(); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -// returns -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/components/svg/annotations/benchmark/benchmark.js b/components/svg/annotations/benchmark/benchmark.js deleted file mode 100644 index e8b4073..0000000 --- a/components/svg/annotations/benchmark/benchmark.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 pkg = require( './../package.json' ).name; -var Annotations = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var node; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = new Annotations(); - if ( !( node instanceof Annotations ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Annotations ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var node; - var i; - - ctor = Annotations; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = ctor(); - if ( !( node instanceof Annotations ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Annotations ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':render', function benchmark( b ) { - var vtree; - var node; - var i; - - node = new Annotations(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - vtree = node.render(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/components/svg/annotations/examples/index.js b/components/svg/annotations/examples/index.js deleted file mode 100644 index 743fb8e..0000000 --- a/components/svg/annotations/examples/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var annotations = require( './../lib' ); - -// Create a new component: -var node = annotations(); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); -// => diff --git a/components/svg/annotations/lib/index.js b/components/svg/annotations/lib/index.js deleted file mode 100644 index b2d44c2..0000000 --- a/components/svg/annotations/lib/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* SVG plot annotations. -* -* @module @stdlib/plot/components/svg/annotations -* -* @example -* var Annotations = require( '@stdlib/plot/components/svg/annotations' ); -* -* var node = new Annotations(); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/annotations/lib/main.js b/components/svg/annotations/lib/main.js deleted file mode 100644 index d7f5ea9..0000000 --- a/components/svg/annotations/lib/main.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var inherit = require( '@stdlib/utils/inherit' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var render = require( './render.js' ); - - -// VARIABLES // - -var debug = logger( 'annotations:main' ); - - -// MAIN // - -/** -* Annotations constructor. -* -* @constructor -* @returns {Annotations} annotations instance -* -* @example -* var node = new Annotations(); -*/ -function Annotations() { - var self; - if ( !instanceOf( this, Annotations ) ) { - return new Annotations(); - } - self = this; - debug( 'Creating an instance...' ); - EventEmitter.call( this ); - this.on( 'change', onChange ); - this.on( '_render', onRender ); - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - self.render(); - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Inherit from the `EventEmitter` prototype. -*/ -inherit( Annotations, EventEmitter ); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Annotations.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var node = new Annotations(); -* -* var vtree = node.render(); -* // returns -*/ -setReadOnly( Annotations.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Annotations; diff --git a/components/svg/annotations/lib/render.js b/components/svg/annotations/lib/render.js deleted file mode 100644 index 80fd830..0000000 --- a/components/svg/annotations/lib/render.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'annotations:render' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var vtree; - var props; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'annotations', - 'className': 'annotations', - 'attributes': { - 'transform': 'translate(0,0)' - } - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/annotations/package.json b/components/svg/annotations/package.json deleted file mode 100644 index 96f6cac..0000000 --- a/components/svg/annotations/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/annotations", - "version": "0.0.0", - "description": "SVG plot annotations.", - "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", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "annotations", - "annotate", - "component", - "virtual", - "dom", - "vdom", - "virtual-dom" - ] -} diff --git a/components/svg/annotations/test/fixtures/vtree.js b/components/svg/annotations/test/fixtures/vtree.js deleted file mode 100644 index 1d704f0..0000000 --- a/components/svg/annotations/test/fixtures/vtree.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'annotations', - 'className': 'annotations', - 'attributes': { - 'transform': 'translate(0,0)' - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/annotations/test/test.js b/components/svg/annotations/test/test.js deleted file mode 100644 index 97c0696..0000000 --- a/components/svg/annotations/test/test.js +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var tape = require( 'tape' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var Annotations = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Annotations, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is a constructor', function test( t ) { - var node = new Annotations(); - t.strictEqual( instanceOf( node, Annotations ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` operator', function test( t ) { - var ctor; - var node; - - ctor = Annotations; - node = ctor(); - - t.strictEqual( instanceOf( node, Annotations ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor returns an event emitter', function test( t ) { - var node = new Annotations(); - t.strictEqual( instanceOf( node, EventEmitter ), true, 'is an event emitter' ); - t.end(); -}); - -tape( 'when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var node = new Annotations(); - node.on( 'render', onRender ); - node.emit( 'change' ); - - function onRender( obj ) { - t.ok( true, 'emits a render event' ); - t.deepEqual( obj, VTREE, 'provides virtual tree' ); - t.end(); - } -}); - -tape( 'the `render` method returns a rendered virtual tree', function test( t ) { - var vtree; - var node; - - node = new Annotations(); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'returns a virtual tree' ); - t.end(); -}); diff --git a/components/svg/axis/examples/index.js b/components/svg/axis/examples/index.js deleted file mode 100644 index 8d063c6..0000000 --- a/components/svg/axis/examples/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var createAxis = require( './../lib' ); - -// Create a function to map data values to pixel values: -var scale = linear(); -scale.domain( [0, 1] ).range( [0, 100] ); - -// Create a new axis: -var axis = createAxis({ - 'scale': scale, - 'orientation': 'bottom', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = axis.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -axis.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - axis.tickSize = 12; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/axis/lib/components/domain.js b/components/svg/axis/lib/components/domain.js deleted file mode 100644 index 7795351..0000000 --- a/components/svg/axis/lib/components/domain.js +++ /dev/null @@ -1,103 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/* -* For manually constructing SVG paths, see [MDN]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d} -*/ - -// MODULES // - -var logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:domain' ); -var ELEMENT = 'path'; - - -// MAIN // - -/** -* Renders an axis domain. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - /* eslint-disable no-underscore-dangle */ - var orient; - var stroke; - var range0; - var range1; - var offset; - var range; - var props; - var d; - - orient = ctx._orientation; - debug( 'Axis orientation: %s.', orient ); - - range = ctx._scale.range(); - debug( 'Axis range: %s.', JSON.stringify( range ) ); - - range0 = range[ 0 ] + 0.5; - range1 = range[ range.length-1 ] + 0.5; - - offset = ctx.tickDir * ctx._outerTickSize; - d = ''; - if ( orient === 'left' || orient === 'right' ) { - d += 'M' + offset + ',' + range0; - d += 'H0.5'; - d += 'V' + range1; - d += 'H' + offset; - - stroke = 'none'; - } else { - d += 'M' + range0 + ',' + offset; - d += 'V0.5'; - d += 'H' + range1; - d += 'V' + offset; - - stroke = '#aaa'; - } - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'axis.domain', - 'className': 'domain', - 'attributes': { - 'fill': 'none', - 'stroke': stroke, - 'stroke-width': 1, - 'd': d - } - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, [] ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/index.js b/components/svg/axis/lib/components/index.js deleted file mode 100644 index 81c8273..0000000 --- a/components/svg/axis/lib/components/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var textAnchor = require( './../utils/text_anchor.js' ); -var domain = require( './domain.js' ); -var ticks = require( './ticks.js' ); -var label = require( './label.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:main' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders an axis. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - var children; - var props; - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'axis', - 'className': 'axis', - 'attributes': { - 'fill': 'none', - 'font-size': 10, // TODO: option - 'font-family': 'sans-serif', // TODO: option - 'text-anchor': textAnchor( ctx._orientation ) // eslint-disable-line no-underscore-dangle - } - }; - - debug( 'Rendering tick marks...' ); - children = ticks( ctx ); - - debug( 'Rendering domain line...' ); - children.unshift( domain( ctx ) ); - - debug( 'Rendering label...' ); - children.push( label( ctx ) ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, children ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/label.js b/components/svg/axis/lib/components/label.js deleted file mode 100644 index 035be04..0000000 --- a/components/svg/axis/lib/components/label.js +++ /dev/null @@ -1,77 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var labelTransform = require( './../utils/label_transform.js' ); -var labelXPos = require( './../utils/label_x_pos.js' ); -var labelYPos = require( './../utils/label_y_pos.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:label' ); -var ELEMENT = 'text'; - - -// MAIN // - -/** -* Renders an axis label. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - /* eslint-disable no-underscore-dangle */ - var orient; - var props; - - orient = ctx._orientation; - debug( 'Axis orientation: %s.', orient ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'axis.label', - 'className': 'label noselect', - 'attributes': { - 'fill': '#000', - 'stroke': 'none', - 'text-anchor': 'middle', - 'transform': labelTransform( orient ), - 'x': labelXPos( orient, ctx._scale.range() ), - 'y': labelYPos( orient ) - } - }; - - debug( 'Axis label: %s.', ctx._label ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, ctx._label ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/line.js b/components/svg/axis/lib/components/line.js deleted file mode 100644 index ada610c..0000000 --- a/components/svg/axis/lib/components/line.js +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var xAttr = require( './../utils/x_attr.js' ); -var yAttr = require( './../utils/y_attr.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:line' ); -var ELEMENT = 'line'; - - -// MAIN // - -/** -* Renders a tick line. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - /* eslint-disable no-underscore-dangle */ - var props; - var x; - var y; - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'attributes': { - 'stroke': '#aaa', - 'stroke-width': 1 - } - }; - - x = xAttr( ctx._orientation ); - y = yAttr( ctx._orientation ); - - props.attributes[ x+'2' ] = ctx.tickDir * ctx._innerTickSize; - props.attributes[ y+'1' ] = 0.5; - props.attributes[ y+'2' ] = 0.5; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, [] ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/text.js b/components/svg/axis/lib/components/text.js deleted file mode 100644 index f28dd7c..0000000 --- a/components/svg/axis/lib/components/text.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var dy = require( './../utils/text_dy.js' ); -var xAttr = require( './../utils/x_attr.js' ); -var yAttr = require( './../utils/y_attr.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:text' ); -var ELEMENT = 'text'; - - -// MAIN // - -/** -* Renders tick text. -* -* @private -* @param {Object} ctx - context -* @param {*} d - tick value -* @returns {VTree} virtual tree -*/ -function render( ctx, d ) { - /* eslint-disable no-underscore-dangle */ - var orient; - var props; - var txt; - var x; - var y; - - orient = ctx._orientation; - debug( 'Axis orientation: %s.', orient ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'attributes': { - 'fill': '#000', - 'dy': dy( orient ) - } - }; - - x = xAttr( orient ); - y = yAttr( orient ); - - props.attributes[ x ] = ctx.tickDir * ctx.tickSpacing; - props.attributes[ y ] = 0.5; - - txt = ctx.tickFormat( d ); - debug( 'Tick text: %s.', txt ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, txt ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/tick.js b/components/svg/axis/lib/components/tick.js deleted file mode 100644 index 7b1c46a..0000000 --- a/components/svg/axis/lib/components/tick.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var line = require( './line.js' ); -var text = require( './text.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:tick' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders an axis tick. -* -* @private -* @param {Object} ctx - context -* @param {*} d - tick value -* @param {Function} transform - tick transform -* @returns {VTree} virtual tree -*/ -function render( ctx, d, transform ) { - var children; - var props; - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'axis.tick', - 'className': 'tick', - 'attributes': { - 'opacity': 1, - 'transform': transform( d ) - } - }; - children = new Array( 2 ); - - debug( 'Rendering a tick line...' ); - children[ 0 ] = line( ctx ); - - debug( 'Rendering tick text...' ); - children[ 1 ] = text( ctx, d ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, children ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/components/ticks.js b/components/svg/axis/lib/components/ticks.js deleted file mode 100644 index 88580a6..0000000 --- a/components/svg/axis/lib/components/ticks.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var tickTransform = require( './../utils/tick_transform.js' ); -var tick = require( './tick.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:components:ticks' ); - - -// MAIN // - -/** -* Renders axis ticks. -* -* @private -* @param {Object} ctx - context -* @returns {Array} array of virtual DOM trees -*/ -function render( ctx ) { - /* eslint-disable no-underscore-dangle */ - var transform; - var values; - var out; - var i; - - values = ctx.ticks; - debug( 'Tick values: %s.', JSON.stringify( values ) ); - - debug( 'Generating tick transform...' ); - transform = tickTransform( ctx._orientation, ctx._scale ); - - debug( 'Rendering ticks...' ); - out = new Array( values.length ); - for ( i = 0; i < values.length; i++ ) { - debug( 'Rendering tick %d with value %s...', i, values[i] ); - out[ i ] = tick( ctx, values[i], transform ); - } - debug( 'Finished rendering ticks.' ); - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/defaults.json b/components/svg/axis/lib/defaults.json deleted file mode 100644 index cf038cd..0000000 --- a/components/svg/axis/lib/defaults.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "scale": null, - "label": "", - "ticks": null, - "numTicks": null, - "tickFormat": null, - "tickSize": 6, - "innerTickSize": 6, - "outerTickSize": 6, - "tickPadding": 3, - "orientation": "bottom", - "autoRender": false -} diff --git a/components/svg/axis/lib/etc/orientations.json b/components/svg/axis/lib/etc/orientations.json deleted file mode 100644 index 2dbe842..0000000 --- a/components/svg/axis/lib/etc/orientations.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "left", - "right", - "top", - "bottom" -] diff --git a/components/svg/axis/lib/events/events.json b/components/svg/axis/lib/events/events.json deleted file mode 100644 index 2a5ecc0..0000000 --- a/components/svg/axis/lib/events/events.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "label": "change", - "numTicks": "change", - "orientation": "change", - "scale": "change", - "tickFormat": "change", - "tickPadding": "change", - "ticks": "change", - "tickSize": "change", - "innerTickSize": "change", - "outerTickSize": "change", - "autoRender": "change" -} diff --git a/components/svg/axis/lib/events/index.js b/components/svg/axis/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/axis/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/index.js b/components/svg/axis/lib/index.js deleted file mode 100644 index 320fba9..0000000 --- a/components/svg/axis/lib/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: remove d3-scale - -/** -* Plot axis. -* -* @module @stdlib/plot/components/svg/axis -* -* @example -* var linear = require( 'd3-scale' ).scaleLinear(); -* var Axis = require( '@stdlib/plot/components/svg/axis' ); -* -* var axis = new Axis({ -* 'scale': linear(), -* 'orient': 'bottom' -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/axis/lib/main.js b/components/svg/axis/lib/main.js deleted file mode 100644 index 372f5b1..0000000 --- a/components/svg/axis/lib/main.js +++ /dev/null @@ -1,573 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: improve JSDoc examples - -// MODULES // - -var EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setScale = require( './props/scale/set.js' ); -var getScale = require( './props/scale/get.js' ); -var setOrientation = require( './props/orientation/set.js' ); -var getOrientation = require( './props/orientation/get.js' ); -var setLabel = require( './props/label/set.js' ); -var getLabel = require( './props/label/get.js' ); -var setTicks = require( './props/ticks/set.js' ); -var getTicks = require( './props/ticks/get.js' ); -var setNumTicks = require( './props/num-ticks/set.js' ); -var getNumTicks = require( './props/num-ticks/get.js' ); -var setTickFormat = require( './props/tick-format/set.js' ); -var getTickFormat = require( './props/tick-format/get.js' ); -var setTickSize = require( './props/tick-size/set.js' ); -var getTickSize = require( './props/tick-size/get.js' ); -var setInnerTickSize = require( './props/inner-tick-size/set.js' ); -var getInnerTickSize = require( './props/inner-tick-size/get.js' ); -var setOuterTickSize = require( './props/outer-tick-size/set.js' ); -var getOuterTickSize = require( './props/outer-tick-size/get.js' ); -var setTickPadding = require( './props/tick-padding/set.js' ); -var getTickPadding = require( './props/tick-padding/get.js' ); -var getTickSpacing = require( './props/tick-spacing/get.js' ); -var getTickDir = require( './props/tick-dir/get.js' ); -var getTickPos = require( './props/tick-pos/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:main' ); - - -// MAIN // - -/** -* Axis constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {Function} [options.scale] - scale function -* @param {string} [options.orientation='bottom'] - axis orientation -* @param {string} [options.label] - axis label -* @param {(Array|null)} [options.ticks] - tick values -* @param {(NonNegativeInteger|null)} [options.numTicks] - number of ticks -* @param {(null|string|Function)} [options.tickFormat] - tick format -* @param {NonNegativeInteger} [options.tickSize=6] - tick size -* @param {NonNegativeInteger} [options.innerTickSize=6] - inner tick size -* @param {NonNegativeInteger} [options.outerTickSize=6] - outer tick size -* @param {NonNegativeInteger} [options.tickPadding=3] - tick padding -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Axis} axis instance -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom' -* }); -*/ -function Axis( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Axis ) ) { - return new Axis( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_scale', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.scale || linear() - }); - defineProperty( this, '_orientation', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.orientation - }); - defineProperty( this, '_label', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.label - }); - defineProperty( this, '_ticks', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.ticks - }); - defineProperty( this, '_numTicks', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.numTicks - }); - defineProperty( this, '_tickFormat', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.tickFormat - }); - defineProperty( this, '_tickSize', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.tickSize - }); - defineProperty( this, '_innerTickSize', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.innerTickSize - }); - defineProperty( this, '_outerTickSize', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.outerTickSize - }); - defineProperty( this, '_tickPadding', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.tickPadding - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Axis.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Axis.prototype.constructor = Axis; - -/** -* Scale function. -* -* @name scale -* @memberof Axis.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var axis = new Axis({ -* 'orientation': 'top' -* }); -* -* var f = axis.scale; -* // returns -*/ -defineProperty( Axis.prototype, 'scale', { - 'configurable': false, - 'enumerable': true, - 'set': setScale, - 'get': getScale -}); - -/** -* Axis orientation. -* -* @name orientation -* @memberof Axis.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default 'bottom' -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom' -* }); -* axis.orientation = 'top'; -* -* var v = axis.orientation; -* // returns 'top' -*/ -defineProperty( Axis.prototype, 'orientation', { - 'configurable': false, - 'enumerable': true, - 'set': setOrientation, - 'get': getOrientation -}); - -/** -* Axis label. -* -* @name label -* @memberof Axis.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var axis = new Axis({ -* 'label': 'y' -* }); -* axis.label = 'Counts'; -* -* var v = axis.label; -* // returns 'Counts' -*/ -defineProperty( Axis.prototype, 'label', { - 'configurable': false, - 'enumerable': true, - 'set': setLabel, - 'get': getLabel -}); - -/** -* Axis tick values. When set to `null`, the retrieved values are the computed tick values. -* -* @name ticks -* @memberof Axis.prototype -* @type {(Array|null)} -* @throws {TypeError} must be an array or null -* @default null -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'ticks': [1,2,3] -* }); -* axis.ticks = ['a','b','c']; -* -* var v = axis.ticks; -* // returns -*/ -defineProperty( Axis.prototype, 'ticks', { - 'configurable': false, - 'enumerable': true, - 'set': setTicks, - 'get': getTicks -}); - -/** -* Number of axis ticks. -* -* @name numTicks -* @memberof Axis.prototype -* @type {(NonNegativeInteger|null)} -* @throws {TypeError} must be a nonnegative integer or null -* @default null -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'numTicks': 10 -* }); -* axis.numTicks = 5; -* -* var v = axis.numTicks; -* // returns 5 -*/ -defineProperty( Axis.prototype, 'numTicks', { - 'configurable': false, - 'enumerable': true, - 'set': setNumTicks, - 'get': getNumTicks -}); - -/** -* Tick format. When retrieved, the returned value is a formatting function. -* -* @name tickFormat -* @memberof Axis.prototype -* @type {(null|string|Function)} -* @throws {TypeError} must be either null, a string, or a function -* @default null -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'tickFormat': ',f' -* }); -* axis.tickFormat = ',.0f'; -* -* var v = axis.tickFormat; -* // returns -*/ -defineProperty( Axis.prototype, 'tickFormat', { - 'configurable': false, - 'enumerable': true, - 'set': setTickFormat, - 'get': getTickFormat -}); - -/** -* Axis tick size. -* -* @name tickSize -* @memberof Axis.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 6 -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'tickSize': 12 -* }); -* axis.tickSize = 8; -* -* var v = axis.tickSize; -* // returns 8 -*/ -defineProperty( Axis.prototype, 'tickSize', { - 'configurable': false, - 'enumerable': true, - 'set': setTickSize, - 'get': getTickSize -}); - -/** -* Axis inner tick size. -* -* @name innerTickSize -* @memberof Axis.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 6 -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'innerTickSize': 10 -* }); -* axis.innerTickSize = 5; -* -* var v = axis.innerTickSize; -* // returns 5 -*/ -defineProperty( Axis.prototype, 'innerTickSize', { - 'configurable': false, - 'enumerable': true, - 'set': setInnerTickSize, - 'get': getInnerTickSize -}); - -/** -* Axis outer tick size. -* -* @name outerTickSize -* @memberof Axis.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 6 -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'outerTickSize': 10 -* }); -* axis.outerTickSize = 5; -* -* var v = axis.outerTickSize; -* // returns 5 -*/ -defineProperty( Axis.prototype, 'outerTickSize', { - 'configurable': false, - 'enumerable': true, - 'set': setOuterTickSize, - 'get': getOuterTickSize -}); - -/** -* Axis tick padding. -* -* @name tickPadding -* @memberof Axis.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 3 -* -* @example -* var axis = new Axis({ -* 'orientation': 'bottom', -* 'tickPadding': 10 -* }); -* axis.tickPadding = 5; -* -* var v = axis.tickPadding; -* // returns 5 -*/ -defineProperty( Axis.prototype, 'tickPadding', { - 'configurable': false, - 'enumerable': true, - 'set': setTickPadding, - 'get': getTickPadding -}); - -/** -* Tick spacing. -* -* @name tickSpacing -* @memberof Axis.prototype -* @type {number} -* -* @example -* var axis = new Axis( {} ); -* -* var spacing = axis.tickSpacing; -* // returns -*/ -defineProperty( Axis.prototype, 'tickSpacing', { - 'configurable': false, - 'enumerable': true, - 'get': getTickSpacing -}); - -/** -* Tick direction. -* -* @name tickDir -* @memberof Axis.prototype -* @type {number} -* -* @example -* var axis = new Axis( {} ); -* -* var dir = axis.tickDir; -* // returns -*/ -defineProperty( Axis.prototype, 'tickDir', { - 'configurable': false, - 'enumerable': true, - 'get': getTickDir -}); - -/** -* Function for computing tick positions. -* -* @name tickPos -* @memberof Axis.prototype -* @type {Function} -* -* @example -* var axis = new Axis( {} ); -* -* var tickPos = axis.tickPos; -* // returns -*/ -defineProperty( Axis.prototype, 'tickPos', { - 'configurable': false, - 'enumerable': true, - 'get': getTickPos -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Axis.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var axis = new Axis({ -* 'autoRender': true -* }); -* -* var mode = axis.autoRender; -* // returns true -*/ -defineProperty( Axis.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Axis.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var axis = new Axis( {} ); -* -* var out = axis.render(); -*/ -setReadOnly( Axis.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Axis; diff --git a/components/svg/axis/lib/methods/render.js b/components/svg/axis/lib/methods/render.js deleted file mode 100644 index 7452869..0000000 --- a/components/svg/axis/lib/methods/render.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var components = require( './../components' ); - - -// VARIABLES // - -var debug = logger( 'axis:render' ); - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var vtree; - - debug( 'Rendering...' ); - vtree = components( this ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/axis/lib/props/auto-render/get.js b/components/svg/axis/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/axis/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/auto-render/set.js b/components/svg/axis/lib/props/auto-render/set.js deleted file mode 100644 index 758fcf0..0000000 --- a/components/svg/axis/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/inner-tick-size/get.js b/components/svg/axis/lib/props/inner-tick-size/get.js deleted file mode 100644 index f343d33..0000000 --- a/components/svg/axis/lib/props/inner-tick-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the inner tick size. -* -* @private -* @returns {NonNegativeInteger} tick size -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._innerTickSize; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/inner-tick-size/set.js b/components/svg/axis/lib/props/inner-tick-size/set.js deleted file mode 100644 index fd5118a..0000000 --- a/components/svg/axis/lib/props/inner-tick-size/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/inner_tick_size.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:ticksize-inner' ); -var CHANGE_EVENT = events( 'innerTickSize' ); - - -// MAIN // - -/** -* Sets the inner tick size. -* -* @private -* @param {NonNegativeInteger} size - size -* @throws {TypeError} must be a nonnegative integer -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - var err = isValid( size ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', size ); - - this._innerTickSize = size; - debug( 'New Value: %s.', this._innerTickSize ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/label/get.js b/components/svg/axis/lib/props/label/get.js deleted file mode 100644 index a6d7816..0000000 --- a/components/svg/axis/lib/props/label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the axis label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._label; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/label/set.js b/components/svg/axis/lib/props/label/set.js deleted file mode 100644 index 96e8db1..0000000 --- a/components/svg/axis/lib/props/label/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/label.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:xlabel' ); -var CHANGE_EVENT = events( 'label' ); - - -// MAIN // - -/** -* Sets the axis label. -* -* @private -* @param {string} label - axis label -* @throws {TypeError} must be a string -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - var err = isValid( label ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', this._label ); - - this._label = label; - debug( 'New value: %s.', this._label ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/num-ticks/get.js b/components/svg/axis/lib/props/num-ticks/get.js deleted file mode 100644 index 792d7ab..0000000 --- a/components/svg/axis/lib/props/num-ticks/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the number of axis ticks. -* -* @private -* @returns {(NonNegativeInteger|null)} number of ticks -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._numTicks; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/num-ticks/set.js b/components/svg/axis/lib/props/num-ticks/set.js deleted file mode 100644 index c0ef5a8..0000000 --- a/components/svg/axis/lib/props/num-ticks/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/num_ticks.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:numticks' ); -var CHANGE_EVENT = events( 'numTicks' ); - - -// MAIN // - -/** -* Sets the number of axis ticks. -* -* @private -* @param {(NonNegativeInteger|null)} num - num -* @throws {TypeError} must be a nonnegative integer or null -*/ -function set( num ) { - /* eslint-disable no-invalid-this */ - var err = isValid( num ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', num ); - - this._numTicks = num; - debug( 'New Value: %s.', this._numTicks ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/orientation/get.js b/components/svg/axis/lib/props/orientation/get.js deleted file mode 100644 index 0d5b896..0000000 --- a/components/svg/axis/lib/props/orientation/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the axis orientation. -* -* @private -* @returns {string} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._orientation; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/orientation/set.js b/components/svg/axis/lib/props/orientation/set.js deleted file mode 100644 index 93629fe..0000000 --- a/components/svg/axis/lib/props/orientation/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/orientation.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:orientation' ); -var CHANGE_EVENT = events( 'orientation' ); - - -// MAIN // - -/** -* Sets the axis orientation. -* -* @private -* @param {string} orient - axis orientation -* @throws {TypeError} must be a string -*/ -function set( orient ) { - /* eslint-disable no-invalid-this */ - var err = isValid( orient ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', this._orientation ); - - this._orientation = orient; - debug( 'New Value: %s.', this._orientation ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/outer-tick-size/get.js b/components/svg/axis/lib/props/outer-tick-size/get.js deleted file mode 100644 index 3dfecb3..0000000 --- a/components/svg/axis/lib/props/outer-tick-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the axis outer tick size. -* -* @private -* @returns {NonNegativeInteger} tick size -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._outerTickSize; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/outer-tick-size/set.js b/components/svg/axis/lib/props/outer-tick-size/set.js deleted file mode 100644 index cf55252..0000000 --- a/components/svg/axis/lib/props/outer-tick-size/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/outer_tick_size.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:ticksize-outer' ); -var CHANGE_EVENT = events( 'outerTickSize' ); - - -// MAIN // - -/** -* Sets the axis outer tick size. -* -* @private -* @param {NonNegativeInteger} size - size -* @throws {TypeError} must be a nonnegative integer -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - var err = isValid( size ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', size ); - - this._outerTickSize = size; - debug( 'New Value: %s.', this._outerTickSize ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/scale/get.js b/components/svg/axis/lib/props/scale/get.js deleted file mode 100644 index 4ef9bb2..0000000 --- a/components/svg/axis/lib/props/scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._scale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/scale/set.js b/components/svg/axis/lib/props/scale/set.js deleted file mode 100644 index e4f7065..0000000 --- a/components/svg/axis/lib/props/scale/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/scale.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:scale' ); -var CHANGE_EVENT = events( 'scale' ); - - -// MAIN // - -/** -* Sets the scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - var err = isValid( fcn ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', this._scale ); - - this._scale = fcn; - debug( 'New Value: %s.', this._scale ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/tick-dir/get.js b/components/svg/axis/lib/props/tick-dir/get.js deleted file mode 100644 index 6b92964..0000000 --- a/components/svg/axis/lib/props/tick-dir/get.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the tick direction. -* -* @private -* @returns {number} tick direction -*/ -function get() { - /* eslint-disable no-invalid-this */ - if ( - this._orientation === 'top' || - this._orientation === 'left' - ) { - return -1; - } - return 1; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/tick-format/get.js b/components/svg/axis/lib/props/tick-format/get.js deleted file mode 100644 index e7cd439..0000000 --- a/components/svg/axis/lib/props/tick-format/get.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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( 'd3-format' ).format; // TODO: remove -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var identity = require( '@stdlib/utils/identity-function' ); - - -// MAIN // - -/** -* Returns the axis tick format. -* -* @private -* @returns {Function} format function -*/ -function get() { - /* eslint-disable no-invalid-this */ - if ( isString( this._tickFormat ) ) { - return format( this._tickFormat ); - } - if ( isNull( this._tickFormat ) ) { - if ( this._scale.tickFormat ) { - return this._scale.tickFormat( this._numTicks, this._tickFormat ); - } - return identity; - } - return this._tickFormat; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/tick-format/set.js b/components/svg/axis/lib/props/tick-format/set.js deleted file mode 100644 index 0f5da33..0000000 --- a/components/svg/axis/lib/props/tick-format/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/tick_format.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:tickformat' ); -var CHANGE_EVENT = events( 'tickFormat' ); - - -// MAIN // - -/** -* Sets the axis tick format. -* -* @private -* @param {(null|string|Function)} fmt - tick format -* @throws {TypeError} must be either null, a string, or a function -*/ -function set( fmt ) { - /* eslint-disable no-invalid-this */ - var err = isValid( fmt ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', this._tickFormat ); - - this._tickFormat = fmt; - debug( 'New Value: %s.', this._tickFormat ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/tick-padding/get.js b/components/svg/axis/lib/props/tick-padding/get.js deleted file mode 100644 index e5d5072..0000000 --- a/components/svg/axis/lib/props/tick-padding/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the axis tick padding. -* -* @private -* @returns {NonNegativeInteger} padding -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._tickPadding; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/tick-padding/set.js b/components/svg/axis/lib/props/tick-padding/set.js deleted file mode 100644 index 841285d..0000000 --- a/components/svg/axis/lib/props/tick-padding/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/tick_padding.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:tickpadding' ); -var CHANGE_EVENT = events( 'tickPadding' ); - - -// MAIN // - -/** -* Sets the axis tick padding. -* -* @private -* @param {NonNegativeInteger} padding - padding -* @throws {TypeError} must be a nonnegative integer -*/ -function set( padding ) { - /* eslint-disable no-invalid-this */ - var err = isValid( padding ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', padding ); - - this._tickPadding = padding; - debug( 'New Value: %s.', this._tickPadding ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/tick-pos/center.js b/components/svg/axis/lib/props/tick-pos/center.js deleted file mode 100644 index 5ee1193..0000000 --- a/components/svg/axis/lib/props/tick-pos/center.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'axis:center' ); - - -// MAIN // - -/** -* Returns a function to center a tick. -* -* @private -* @returns {Function} function to center a tick -*/ -function center() { - /* eslint-disable no-invalid-this */ - var width = this._scale.bandwidth() / 2; - return center; - - /** - * Returns a centered tick position. - * - * @private - * @param {*} d - datum - * @returns {number} tick position - */ - function center( d ) { - var pos = this._scale( d ) + width; - debug( 'Value: %s => Coordinate: %d', d, pos ); - return pos; - } -} - - -// EXPORTS // - -module.exports = center; diff --git a/components/svg/axis/lib/props/tick-pos/get.js b/components/svg/axis/lib/props/tick-pos/get.js deleted file mode 100644 index e29d88b..0000000 --- a/components/svg/axis/lib/props/tick-pos/get.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 center = require( './center.js' ); - - -// MAIN // - -/** -* Returns a function for positioning ticks. -* -* @private -* @returns {Function} position function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this._scale.copy(); - if ( scale.bandwidth ) { - return center( scale ); - } - return scale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/tick-size/get.js b/components/svg/axis/lib/props/tick-size/get.js deleted file mode 100644 index 63c5fb3..0000000 --- a/components/svg/axis/lib/props/tick-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the axis tick size. -* -* @private -* @returns {NonNegativeInteger} tick size -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._tickSize; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/tick-size/set.js b/components/svg/axis/lib/props/tick-size/set.js deleted file mode 100644 index ffdeb33..0000000 --- a/components/svg/axis/lib/props/tick-size/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/tick_size.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:ticksize' ); -var CHANGE_EVENT = events( 'tickSize' ); - - -// MAIN // - -/** -* Sets the axis tick size. -* -* @private -* @param {NonNegativeInteger} size - size -* @throws {TypeError} must be a nonnegative integer -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - var err = isValid( size ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', size ); - - this._tickSize = size; - debug( 'New Value: %s.', this._tickSize ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/props/tick-spacing/get.js b/components/svg/axis/lib/props/tick-spacing/get.js deleted file mode 100644 index 9040325..0000000 --- a/components/svg/axis/lib/props/tick-spacing/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the tick spacing. -* -* @private -* @returns {number} tick spacing -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._innerTickSize + this._tickPadding; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/ticks/get.js b/components/svg/axis/lib/props/ticks/get.js deleted file mode 100644 index 5824099..0000000 --- a/components/svg/axis/lib/props/ticks/get.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); - - -// MAIN // - -/** -* Returns the axis tick values. -* -* @private -* @returns {Array} ticks -*/ -function get() { - /* eslint-disable no-invalid-this */ - if ( isNull( this._ticks ) ) { - if ( this._scale.ticks ) { - return this._scale.ticks( this._numTicks, this._tickFormat ); - } - return this._scale.domain(); - } - return this._ticks.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/axis/lib/props/ticks/set.js b/components/svg/axis/lib/props/ticks/set.js deleted file mode 100644 index f16e332..0000000 --- a/components/svg/axis/lib/props/ticks/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/ticks.js' ); - - -// VARIABLES // - -var debug = logger( 'axis:set:ticks' ); -var CHANGE_EVENT = events( 'ticks' ); - - -// MAIN // - -/** -* Sets the axis tick values. -* -* @private -* @param {(Array|null)} ticks - tick values -* @throws {TypeError} must be an array or null -*/ -function set( ticks ) { - /* eslint-disable no-invalid-this */ - var err = isValid( ticks ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', JSON.stringify( this._ticks ) ); - - if ( isNull( ticks ) ) { - this._ticks = ticks; - } else { - this._ticks = ticks.slice(); - } - debug( 'New Value: %s.', JSON.stringify( this._ticks ) ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/axis/lib/utils/label_transform.js b/components/svg/axis/lib/utils/label_transform.js deleted file mode 100644 index 3c5111b..0000000 --- a/components/svg/axis/lib/utils/label_transform.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a label SVG transform. -* -* @private -* @param {string} orient - axis orientation -* @returns {string} SVG transform -*/ -function labelTransform( orient ) { - if ( orient === 'bottom' || orient === 'top' ) { - return 'rotate(0)'; - } - if ( orient === 'left' ) { - return 'rotate(-90)'; - } - // orient === 'right' - return 'rotate(90)'; -} - - -// EXPORTS // - -module.exports = labelTransform; diff --git a/components/svg/axis/lib/utils/label_x_pos.js b/components/svg/axis/lib/utils/label_x_pos.js deleted file mode 100644 index 5b92f87..0000000 --- a/components/svg/axis/lib/utils/label_x_pos.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the label `x` coordinate. -* -* @private -* @param {string} orient - axis orientation -* @param {NumericArray} range - scale range -* @returns {number} `x` coordinate -*/ -function labelXPos( orient, range ) { - if ( orient === 'left' || orient === 'right' ) { - return -range[0] / 2; - } - return range[1] / 2; -} - - -// EXPORTS // - -module.exports = labelXPos; diff --git a/components/svg/axis/lib/utils/label_y_pos.js b/components/svg/axis/lib/utils/label_y_pos.js deleted file mode 100644 index 6c277c0..0000000 --- a/components/svg/axis/lib/utils/label_y_pos.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the label `y` coordinate. -* -* @private -* @param {string} orient - axis orientation -* @returns {number} `y` coordinate -*/ -function labelYPos( orient ) { - if ( orient === 'left' ) { - return -72; - } - if ( orient === 'right' ) { - return 72; - } - if ( orient === 'bottom' ) { - return 45; - } - // orient === 'top' - return -45; -} - - -// EXPORTS // - -module.exports = labelYPos; diff --git a/components/svg/axis/lib/utils/text_anchor.js b/components/svg/axis/lib/utils/text_anchor.js deleted file mode 100644 index c46a92a..0000000 --- a/components/svg/axis/lib/utils/text_anchor.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the text anchor value for text positioning. -* -* @private -* @param {string} orient - axis orientation -* @returns {string} text anchor value -*/ -function textAnchor( orient ) { - if ( orient === 'left' ) { - return 'end'; - } - if ( orient === 'right' ) { - return 'start'; - } - return 'middle'; -} - - -// EXPORTS // - -module.exports = textAnchor; diff --git a/components/svg/axis/lib/utils/text_dy.js b/components/svg/axis/lib/utils/text_dy.js deleted file mode 100644 index 8b9d22a..0000000 --- a/components/svg/axis/lib/utils/text_dy.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns vertical shift for aligning tick text. -* -* @private -* @param {string} orient - axis orientation -* @returns {string} text shift -*/ -function dy( orient ) { - if ( orient === 'top' ) { - return '0em'; - } - if ( orient === 'bottom' ) { - return '.71em'; - } - return '.32em'; -} - - -// EXPORTS // - -module.exports = dy; diff --git a/components/svg/axis/lib/utils/tick_transform.js b/components/svg/axis/lib/utils/tick_transform.js deleted file mode 100644 index 6bc43ae..0000000 --- a/components/svg/axis/lib/utils/tick_transform.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 translateX = require( './translate_x.js' ); -var translateY = require( './translate_y.js' ); - - -// MAIN // - -/** -* Returns a function to translate ticks. -* -* @private -* @param {string} orient - axis orientation -* @param {Function} scale - scale function -* @returns {Function} transform function -*/ -function tickTransform( orient, scale ) { - if ( orient === 'top' || orient === 'bottom' ) { - return translateX( scale ); - } - return translateY( scale ); -} - - -// EXPORTS // - -module.exports = tickTransform; diff --git a/components/svg/axis/lib/utils/translate_x.js b/components/svg/axis/lib/utils/translate_x.js deleted file mode 100644 index 367e71d..0000000 --- a/components/svg/axis/lib/utils/translate_x.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'axis:engine:translate-x' ); - - -// MAIN // - -/** -* Returns a function to horizontally translate a tick. -* -* @private -* @param {Function} scale - scale function -* @returns {Function} function to translate a tick -*/ -function translateX( scale ) { - return translateX; - - /** - * Horizontally translates a tick. - * - * @private - * @param {*} d - datum - * @returns {string} transform - */ - function translateX( d ) { - var t = 'translate('+scale( d )+',0)'; - debug( 'Value: %s => Transform: %s.', d, t ); - return t; - } -} - - -// EXPORTS // - -module.exports = translateX; diff --git a/components/svg/axis/lib/utils/translate_y.js b/components/svg/axis/lib/utils/translate_y.js deleted file mode 100644 index d887e7a..0000000 --- a/components/svg/axis/lib/utils/translate_y.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'axis:engine:translate-y' ); - - -// MAIN // - -/** -* Returns a function to vertically translate a tick. -* -* @private -* @param {Function} scale - scale function -* @returns {Function} function to translate a tick -*/ -function translateY( scale ) { - return translateY; - - /** - * Vertically translates a tick. - * - * @private - * @param {*} d - datum - * @returns {string} transform - */ - function translateY( d ) { - var t = 'translate(0,'+scale( d )+')'; - debug( 'Value: %s => Transform: %s.', d, t ); - return t; - } -} - - -// EXPORTS // - -module.exports = translateY; diff --git a/components/svg/axis/lib/utils/x_attr.js b/components/svg/axis/lib/utils/x_attr.js deleted file mode 100644 index a191df2..0000000 --- a/components/svg/axis/lib/utils/x_attr.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the "x" attribute for tick positioning. -* -* @private -* @param {string} orient - axis orientation -* @returns {string} attribute -*/ -function xAttr( orient ) { - if ( orient === 'left' || orient === 'right' ) { - return 'x'; - } - return 'y'; -} - - -// EXPORTS // - -module.exports = xAttr; diff --git a/components/svg/axis/lib/utils/y_attr.js b/components/svg/axis/lib/utils/y_attr.js deleted file mode 100644 index ad146b7..0000000 --- a/components/svg/axis/lib/utils/y_attr.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the "y" attribute for tick positioning. -* -* @private -* @param {string} orient - axis orientation -* @returns {string} attribute -*/ -function yAttr( orient ) { - if ( orient === 'left' || orient === 'right' ) { - return 'y'; - } - return 'x'; -} - - -// EXPORTS // - -module.exports = yAttr; diff --git a/components/svg/axis/lib/validate.js b/components/svg/axis/lib/validate.js deleted file mode 100644 index 7f7be86..0000000 --- a/components/svg/axis/lib/validate.js +++ /dev/null @@ -1,92 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {Function} [options.scale] - scale function -* @param {string} [options.orientation] - axis orientation -* @param {string} [options.label] - axis label -* @param {(Array|null)} [options.ticks] - tick values -* @param {(NonNegativeInteger|null)} [options.numTicks] - number of ticks -* @param {(null|string|Function)} [options.tickFormat] - tick format -* @param {NonNegativeInteger} [options.tickSize] - tick size -* @param {NonNegativeInteger} [options.innerTickSize] - inner tick size -* @param {NonNegativeInteger} [options.outerTickSize] - outer tick size -* @param {NonNegativeInteger} [options.tickPadding] - tick padding -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'scale': function scale(){}, -* 'orientation': 'left', -* 'tickSize': 10 -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/axis/lib/validators/auto_render.js b/components/svg/axis/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/axis/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/index.js b/components/svg/axis/lib/validators/index.js deleted file mode 100644 index b849e7f..0000000 --- a/components/svg/axis/lib/validators/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 autoRender = require( './auto_render.js' ); -var label = require( './label.js' ); -var numTicks = require( './num_ticks.js' ); -var orientation = require( './orientation.js' ); -var scale = require( './scale.js' ); -var tickFormat = require( './tick_format.js' ); -var tickPadding = require( './tick_padding.js' ); -var ticks = require( './ticks.js' ); -var tickSize = require( './tick_size.js' ); -var innerTickSize = require( './inner_tick_size.js' ); -var outerTickSize = require( './outer_tick_size.js' ); - - -// MAIN // - -var validators = { - 'autoRender': autoRender, - 'label': label, - 'numTicks': numTicks, - 'orientation': orientation, - 'scale': scale, - 'tickFormat': tickFormat, - 'tickPadding': tickPadding, - 'ticks': ticks, - 'tickSize': tickSize, - 'innerTickSize': innerTickSize, - 'outerTickSize': outerTickSize -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/axis/lib/validators/inner_tick_size.js b/components/svg/axis/lib/validators/inner_tick_size.js deleted file mode 100644 index 8271f9c..0000000 --- a/components/svg/axis/lib/validators/inner_tick_size.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `innerTickSize`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'innerTickSize', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/label.js b/components/svg/axis/lib/validators/label.js deleted file mode 100644 index ca11a1c..0000000 --- a/components/svg/axis/lib/validators/label.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `label`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isString( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'label', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/num_ticks.js b/components/svg/axis/lib/validators/num_ticks.js deleted file mode 100644 index 51e366b..0000000 --- a/components/svg/axis/lib/validators/num_ticks.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `numTicks`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( - !isNull( v ) && - !isNonNegativeInteger( v ) - ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'numTicks', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/orientation.js b/components/svg/axis/lib/validators/orientation.js deleted file mode 100644 index c38f5ab..0000000 --- a/components/svg/axis/lib/validators/orientation.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './../etc/orientations.json' ); - - -// MAIN // - -/** -* Validates `orientation`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( indexOf( ORIENTATIONS, v ) === -1 ) { - return new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/outer_tick_size.js b/components/svg/axis/lib/validators/outer_tick_size.js deleted file mode 100644 index 6f78b85..0000000 --- a/components/svg/axis/lib/validators/outer_tick_size.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `outerTickSize`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'outerTickSize', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/scale.js b/components/svg/axis/lib/validators/scale.js deleted file mode 100644 index d0636cd..0000000 --- a/components/svg/axis/lib/validators/scale.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `scale`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isFunction( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'scale', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/tick_format.js b/components/svg/axis/lib/validators/tick_format.js deleted file mode 100644 index 8cf488b..0000000 --- a/components/svg/axis/lib/validators/tick_format.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `tickFormat`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( - !isNull( v ) && - !isString( v ) && - !isFunction( v ) - ) { - return new TypeError( format( 'invalid assignment. `%s` must be a string, function, or null. Value: `%s`.', 'tickFormat', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/tick_padding.js b/components/svg/axis/lib/validators/tick_padding.js deleted file mode 100644 index ac7a624..0000000 --- a/components/svg/axis/lib/validators/tick_padding.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `tickPadding`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'tickPadding', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/tick_size.js b/components/svg/axis/lib/validators/tick_size.js deleted file mode 100644 index 5365994..0000000 --- a/components/svg/axis/lib/validators/tick_size.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `tickSize`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'tickSize', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/lib/validators/ticks.js b/components/svg/axis/lib/validators/ticks.js deleted file mode 100644 index 5bdbd37..0000000 --- a/components/svg/axis/lib/validators/ticks.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var isArray = require( '@stdlib/assert/is-array' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `ticks`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( - !isNull( v ) && - !isArray( v ) - ) { - return new TypeError( format( 'invalid assignment. `%s` must be null or an array. Value: `%s`.', 'ticks', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/axis/package.json b/components/svg/axis/package.json deleted file mode 100644 index 549278e..0000000 --- a/components/svg/axis/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/axis", - "version": "0.0.0", - "description": "Axis.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "axis", - "axes", - "component" - ] -} diff --git a/components/svg/background/examples/index.js b/components/svg/background/examples/index.js deleted file mode 100644 index 8fe2b59..0000000 --- a/components/svg/background/examples/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var background = require( './../lib' ); - -// Create a new background: -var bkgd = background({ - 'width': 400, - 'height': 400, - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = bkgd.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -bkgd.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - bkgd.width = 500; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/background/lib/defaults.json b/components/svg/background/lib/defaults.json deleted file mode 100644 index 93a4318..0000000 --- a/components/svg/background/lib/defaults.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "width": 400, - "height": 400, - "autoRender": false -} diff --git a/components/svg/background/lib/events/events.json b/components/svg/background/lib/events/events.json deleted file mode 100644 index de277aa..0000000 --- a/components/svg/background/lib/events/events.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "width": "change", - "height": "change", - "autoRender": "change" -} diff --git a/components/svg/background/lib/events/index.js b/components/svg/background/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/background/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/background/lib/index.js b/components/svg/background/lib/index.js deleted file mode 100644 index 538b38a..0000000 --- a/components/svg/background/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Background. -* -* @module @stdlib/plot/components/svg/background -* -* @example -* var Background = require( '@stdlib/plot/components/svg/background' ); -* -* var bkgd = new Background({ -* 'width': 400, -* 'height': 400 -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/background/lib/main.js b/components/svg/background/lib/main.js deleted file mode 100644 index 4f9050b..0000000 --- a/components/svg/background/lib/main.js +++ /dev/null @@ -1,233 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setWidth = require( './props/width/set.js' ); -var getWidth = require( './props/width/get.js' ); -var setHeight = require( './props/height/set.js' ); -var getHeight = require( './props/height/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'background:main' ); - - -// MAIN // - -/** -* Background constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {PositiveNumber} [options.width=400] - width -* @param {PositiveNumber} [options.height=400] - height -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Background} background instance -* -* @example -* var bkgd = new Background({ -* 'width': 500, -* 'height': 500 -* }); -*/ -function Background( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Background ) ) { - return new Background( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_width', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.width - }); - defineProperty( this, '_height', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.height - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Background.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Background.prototype.constructor = Background; - -/** -* Width. -* -* @name width -* @memberof Background.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var bkgd = new Background({ -* 'width': 500 -* }); -* -* var width = bkgd.width; -* // returns 500 -*/ -defineProperty( Background.prototype, 'width', { - 'configurable': false, - 'enumerable': true, - 'set': setWidth, - 'get': getWidth -}); - -/** -* Height. -* -* @name height -* @memberof Background.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var bkgd = new Background({ -* 'height': 500 -* }); -* -* var height = bkgd.height; -* // returns 500 -*/ -defineProperty( Background.prototype, 'height', { - 'configurable': false, - 'enumerable': true, - 'set': setHeight, - 'get': getHeight -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Background.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var bkgd = new Background({ -* 'autoRender': true -* }); -* -* var mode = bkgd.autoRender; -* // returns true -*/ -defineProperty( Background.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Background.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var bkgd = new Background(); -* -* var out = bkgd.render(); -*/ -setReadOnly( Background.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Background; diff --git a/components/svg/background/lib/methods/render.js b/components/svg/background/lib/methods/render.js deleted file mode 100644 index c924b42..0000000 --- a/components/svg/background/lib/methods/render.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'background:render' ); -var ELEMENT = 'rect'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'className': 'background', - 'attributes': { - 'x': 0, - 'y': 0, - 'width': this.width, - 'height': this.height, - 'fill': 'none', - 'stroke': 'none' - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/background/lib/props/auto-render/get.js b/components/svg/background/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/background/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/background/lib/props/auto-render/set.js b/components/svg/background/lib/props/auto-render/set.js deleted file mode 100644 index b1097de..0000000 --- a/components/svg/background/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'background:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/background/lib/props/height/get.js b/components/svg/background/lib/props/height/get.js deleted file mode 100644 index 64bcb89..0000000 --- a/components/svg/background/lib/props/height/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the height. -* -* @private -* @returns {number} height -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._height; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/background/lib/props/height/set.js b/components/svg/background/lib/props/height/set.js deleted file mode 100644 index ef83a99..0000000 --- a/components/svg/background/lib/props/height/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/height.js' ); - - -// VARIABLES // - -var debug = logger( 'background:set:height' ); -var CHANGE_EVENT = events( 'height' ); - - -// MAIN // - -/** -* Sets the height. -* -* @private -* @param {PositiveNumber} height - height -* @throws {TypeError} must be a positive number -*/ -function set( height ) { - /* eslint-disable no-invalid-this */ - var err = isValid( height ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._height ); - - this._height = height; - debug( 'New Value: %d.', this._height ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/background/lib/props/width/get.js b/components/svg/background/lib/props/width/get.js deleted file mode 100644 index cfa5f0e..0000000 --- a/components/svg/background/lib/props/width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the width. -* -* @private -* @returns {number} width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/background/lib/props/width/set.js b/components/svg/background/lib/props/width/set.js deleted file mode 100644 index 17b6097..0000000 --- a/components/svg/background/lib/props/width/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/width.js' ); - - -// VARIABLES // - -var debug = logger( 'background:set:width' ); -var CHANGE_EVENT = events( 'width' ); - - -// MAIN // - -/** -* Sets the width. -* -* @private -* @param {PositiveNumber} width - width -* @throws {TypeError} must be a positive number -*/ -function set( width ) { - /* eslint-disable no-invalid-this */ - var err = isValid( width ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._width ); - - this._width = width; - debug( 'New value: %d.', this._width ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/background/lib/validate.js b/components/svg/background/lib/validate.js deleted file mode 100644 index 311756c..0000000 --- a/components/svg/background/lib/validate.js +++ /dev/null @@ -1,84 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {PositiveNumber} [options.width] - width -* @param {PositiveNumber} [options.height] - height -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'width': 400, -* 'height': 400 -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/background/lib/validators/auto_render.js b/components/svg/background/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/background/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/background/lib/validators/height.js b/components/svg/background/lib/validators/height.js deleted file mode 100644 index 82ea73c..0000000 --- a/components/svg/background/lib/validators/height.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `height`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/background/lib/validators/index.js b/components/svg/background/lib/validators/index.js deleted file mode 100644 index 9ab29fd..0000000 --- a/components/svg/background/lib/validators/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 width = require( './width.js' ); -var height = require( './height.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'width': width, - 'height': height, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/background/lib/validators/width.js b/components/svg/background/lib/validators/width.js deleted file mode 100644 index e6d8f77..0000000 --- a/components/svg/background/lib/validators/width.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `width`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/background/package.json b/components/svg/background/package.json deleted file mode 100644 index 91e1169..0000000 --- a/components/svg/background/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/background", - "version": "0.0.0", - "description": "SVG background.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "background", - "bkgd", - "component" - ] -} diff --git a/components/svg/canvas/examples/index.js b/components/svg/canvas/examples/index.js deleted file mode 100644 index a95a9b9..0000000 --- a/components/svg/canvas/examples/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var canvas = require( './../lib' ); - -// Create a new canvas: -var node = canvas({ - 'width': 400, - 'height': 400, - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -node.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - node.width = 500; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/canvas/lib/defaults.json b/components/svg/canvas/lib/defaults.json deleted file mode 100644 index 93a4318..0000000 --- a/components/svg/canvas/lib/defaults.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "width": 400, - "height": 400, - "autoRender": false -} diff --git a/components/svg/canvas/lib/events/events.json b/components/svg/canvas/lib/events/events.json deleted file mode 100644 index de277aa..0000000 --- a/components/svg/canvas/lib/events/events.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "width": "change", - "height": "change", - "autoRender": "change" -} diff --git a/components/svg/canvas/lib/events/index.js b/components/svg/canvas/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/canvas/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/canvas/lib/index.js b/components/svg/canvas/lib/index.js deleted file mode 100644 index 97a74a8..0000000 --- a/components/svg/canvas/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Canvas. -* -* @module @stdlib/plot/components/svg/canvas -* -* @example -* var Canvas = require( '@stdlib/plot/components/svg/canvas' ); -* -* var canvas = new Canvas({ -* 'width': 400, -* 'height': 400 -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/canvas/lib/main.js b/components/svg/canvas/lib/main.js deleted file mode 100644 index bfee537..0000000 --- a/components/svg/canvas/lib/main.js +++ /dev/null @@ -1,233 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setWidth = require( './props/width/set.js' ); -var getWidth = require( './props/width/get.js' ); -var setHeight = require( './props/height/set.js' ); -var getHeight = require( './props/height/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:main' ); - - -// MAIN // - -/** -* Canvas constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {PositiveNumber} [options.width=400] - width -* @param {PositiveNumber} [options.height=400] - height -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Canvas} canvas instance -* -* @example -* var canvas = new Canvas({ -* 'width': 500, -* 'height': 500 -* }); -*/ -function Canvas( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Canvas ) ) { - return new Canvas( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_width', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.width - }); - defineProperty( this, '_height', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.height - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Canvas.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Canvas.prototype.constructor = Canvas; - -/** -* Width. -* -* @name width -* @memberof Canvas.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var canvas = new Canvas({ -* 'width': 500 -* }); -* -* var width = canvas.width; -* // returns 500 -*/ -defineProperty( Canvas.prototype, 'width', { - 'configurable': false, - 'enumerable': true, - 'set': setWidth, - 'get': getWidth -}); - -/** -* Height. -* -* @name height -* @memberof Canvas.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var canvas = new Canvas({ -* 'height': 500 -* }); -* -* var height = canvas.height; -* // returns 500 -*/ -defineProperty( Canvas.prototype, 'height', { - 'configurable': false, - 'enumerable': true, - 'set': setHeight, - 'get': getHeight -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Canvas.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var canvas = new Canvas({ -* 'autoRender': true -* }); -* -* var mode = canvas.autoRender; -* // returns true -*/ -defineProperty( Canvas.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Canvas.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var canvas = new Canvas({}); -* -* var out = canvas.render(); -*/ -setReadOnly( Canvas.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Canvas; diff --git a/components/svg/canvas/lib/methods/render.js b/components/svg/canvas/lib/methods/render.js deleted file mode 100644 index f7ec884..0000000 --- a/components/svg/canvas/lib/methods/render.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:render' ); -var ELEMENT = 'svg'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'canvas', - 'className': 'canvas', - 'attributes': { - 'width': this.width, - 'height': this.height - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/canvas/lib/props/auto-render/get.js b/components/svg/canvas/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/canvas/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/canvas/lib/props/auto-render/set.js b/components/svg/canvas/lib/props/auto-render/set.js deleted file mode 100644 index 2119176..0000000 --- a/components/svg/canvas/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/canvas/lib/props/height/get.js b/components/svg/canvas/lib/props/height/get.js deleted file mode 100644 index 64bcb89..0000000 --- a/components/svg/canvas/lib/props/height/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the height. -* -* @private -* @returns {number} height -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._height; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/canvas/lib/props/height/set.js b/components/svg/canvas/lib/props/height/set.js deleted file mode 100644 index 3fa9530..0000000 --- a/components/svg/canvas/lib/props/height/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/height.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:set:height' ); -var CHANGE_EVENT = events( 'height' ); - - -// MAIN // - -/** -* Sets the height. -* -* @private -* @param {PositiveNumber} height - height -* @throws {TypeError} must be a positive number -*/ -function set( height ) { - /* eslint-disable no-invalid-this */ - var err = isValid( height ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._height ); - - this._height = height; - debug( 'New Value: %d.', this._height ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/canvas/lib/props/width/get.js b/components/svg/canvas/lib/props/width/get.js deleted file mode 100644 index cfa5f0e..0000000 --- a/components/svg/canvas/lib/props/width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the width. -* -* @private -* @returns {number} width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/canvas/lib/props/width/set.js b/components/svg/canvas/lib/props/width/set.js deleted file mode 100644 index 5fb581d..0000000 --- a/components/svg/canvas/lib/props/width/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/width.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:set:width' ); -var CHANGE_EVENT = events( 'width' ); - - -// MAIN // - -/** -* Sets the width. -* -* @private -* @param {PositiveNumber} width - width -* @throws {TypeError} must be a positive number -*/ -function set( width ) { - /* eslint-disable no-invalid-this */ - var err = isValid( width ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._width ); - - this._width = width; - debug( 'New value: %d.', this._width ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/canvas/lib/validate.js b/components/svg/canvas/lib/validate.js deleted file mode 100644 index 311756c..0000000 --- a/components/svg/canvas/lib/validate.js +++ /dev/null @@ -1,84 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {PositiveNumber} [options.width] - width -* @param {PositiveNumber} [options.height] - height -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'width': 400, -* 'height': 400 -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/canvas/lib/validators/auto_render.js b/components/svg/canvas/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/canvas/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/canvas/lib/validators/height.js b/components/svg/canvas/lib/validators/height.js deleted file mode 100644 index 82ea73c..0000000 --- a/components/svg/canvas/lib/validators/height.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `height`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/canvas/lib/validators/index.js b/components/svg/canvas/lib/validators/index.js deleted file mode 100644 index 9ab29fd..0000000 --- a/components/svg/canvas/lib/validators/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 width = require( './width.js' ); -var height = require( './height.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'width': width, - 'height': height, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/canvas/lib/validators/width.js b/components/svg/canvas/lib/validators/width.js deleted file mode 100644 index e6d8f77..0000000 --- a/components/svg/canvas/lib/validators/width.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `width`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/canvas/package.json b/components/svg/canvas/package.json deleted file mode 100644 index a40cda1..0000000 --- a/components/svg/canvas/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/canvas", - "version": "0.0.0", - "description": "SVG canvas.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "canvas", - "component" - ] -} diff --git a/components/svg/clip-path/examples/index.js b/components/svg/clip-path/examples/index.js deleted file mode 100644 index 45fbc5c..0000000 --- a/components/svg/clip-path/examples/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var clipPath = require( './../lib' ); - -// Create a new clipPath: -var cp = clipPath({ - 'width': 400, - 'height': 400, - 'id': '1234', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = cp.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -cp.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - cp.id = '4321'; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/clip-path/lib/components/index.js b/components/svg/clip-path/lib/components/index.js deleted file mode 100644 index 8226c92..0000000 --- a/components/svg/clip-path/lib/components/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var rect = require( './rect.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:components:main' ); -var ELEMENT = 'clipPath'; - - -// MAIN // - -/** -* Renders a clipping path. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - var children; - var props; - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'id': ctx.id - }; - - debug( 'Rendering clipping path rectangle...' ); - children = [ - rect( ctx ) - ]; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, children ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/clip-path/lib/components/rect.js b/components/svg/clip-path/lib/components/rect.js deleted file mode 100644 index e1387d8..0000000 --- a/components/svg/clip-path/lib/components/rect.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:components:rect' ); -var ELEMENT = 'rect'; - - -// MAIN // - -/** -* Renders a clipping path rectangle. -* -* @private -* @param {Object} ctx - context -* @returns {VTree} virtual tree -*/ -function render( ctx ) { - var props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'className': 'clipPath', - 'attributes': { - 'width': ctx.width, - 'height': ctx.height - } - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - - return h( ELEMENT, props, [] ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/clip-path/lib/defaults.json b/components/svg/clip-path/lib/defaults.json deleted file mode 100644 index 914f1d7..0000000 --- a/components/svg/clip-path/lib/defaults.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "width": 400, - "height": 400, - "id": "", - "autoRender": false -} diff --git a/components/svg/clip-path/lib/events/events.json b/components/svg/clip-path/lib/events/events.json deleted file mode 100644 index 8f7744c..0000000 --- a/components/svg/clip-path/lib/events/events.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "width": "change", - "height": "change", - "id": "change", - "autoRender": "change" -} diff --git a/components/svg/clip-path/lib/events/index.js b/components/svg/clip-path/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/clip-path/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/clip-path/lib/index.js b/components/svg/clip-path/lib/index.js deleted file mode 100644 index 8be487e..0000000 --- a/components/svg/clip-path/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Clipping path. -* -* @module @stdlib/plot/components/svg/clip-path -* -* @example -* var ClipPath = require( '@stdlib/plot/components/svg/clip-path' ); -* -* var clipPath = new ClipPath({ -* 'width': 400, -* 'height': 400 -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/clip-path/lib/main.js b/components/svg/clip-path/lib/main.js deleted file mode 100644 index 38af904..0000000 --- a/components/svg/clip-path/lib/main.js +++ /dev/null @@ -1,266 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var minstd = require( '@stdlib/random/base/minstd' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setWidth = require( './props/width/set.js' ); -var getWidth = require( './props/width/get.js' ); -var setHeight = require( './props/height/set.js' ); -var getHeight = require( './props/height/get.js' ); -var setID = require( './props/id/set.js' ); -var getID = require( './props/id/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:main' ); - - -// MAIN // - -/** -* Clipping path constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {PositiveNumber} [options.width=400] - width -* @param {PositiveNumber} [options.height=400] - height -* @param {string} [options.id] - clipping path id -* @param {boolean} [options.autoRender=true] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {ClipPath} clipping path instance -* -* @example -* var clipPath = new ClipPath({ -* 'width': 500, -* 'height': 500 -* }); -*/ -function ClipPath( options ) { - var self; - var opts; - var err; - if ( !( this instanceof ClipPath ) ) { - return new ClipPath( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_width', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.width - }); - defineProperty( this, '_height', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.height - }); - defineProperty( this, '_id', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.id || minstd().toString() // TODO: uuid - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -ClipPath.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -ClipPath.prototype.constructor = ClipPath; - -/** -* Width. -* -* @name width -* @memberof ClipPath.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var clipPath = new ClipPath({ -* 'width': 500 -* }); -* -* var width = clipPath.width; -* // returns 500 -*/ -defineProperty( ClipPath.prototype, 'width', { - 'configurable': false, - 'enumerable': true, - 'set': setWidth, - 'get': getWidth -}); - -/** -* Height. -* -* @name height -* @memberof ClipPath.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 -* -* @example -* var clipPath = new ClipPath({ -* 'height': 500 -* }); -* -* var height = clipPath.height; -* // returns 500 -*/ -defineProperty( ClipPath.prototype, 'height', { - 'configurable': false, - 'enumerable': true, - 'set': setHeight, - 'get': getHeight -}); - -/** -* Clipping path id. -* -* @name id -* @memberof ClipPath.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var clipPath = new ClipPath({ -* 'id': '1234' -* }); -* -* var id = clipPath.id; -* // returns '1234' -*/ -defineProperty( ClipPath.prototype, 'id', { - 'configurable': false, - 'enumerable': true, - 'set': setID, - 'get': getID -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof ClipPath.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var clipPath = new ClipPath({ -* 'autoRender': true -* }); -* -* var mode = clipPath.autoRender; -* // returns true -*/ -defineProperty( ClipPath.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof ClipPath.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var clipPath = new ClipPath(); -* -* var out = clipPath.render(); -*/ -setReadOnly( ClipPath.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = ClipPath; diff --git a/components/svg/clip-path/lib/methods/render.js b/components/svg/clip-path/lib/methods/render.js deleted file mode 100644 index b130497..0000000 --- a/components/svg/clip-path/lib/methods/render.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var components = require( './../components' ); - - -// VARIABLES // - -var debug = logger( 'clippath:render' ); - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var vtree; - - debug( 'Rendering...' ); - vtree = components( this ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/clip-path/lib/props/auto-render/get.js b/components/svg/clip-path/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/clip-path/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/clip-path/lib/props/auto-render/set.js b/components/svg/clip-path/lib/props/auto-render/set.js deleted file mode 100644 index b2c961c..0000000 --- a/components/svg/clip-path/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'clip-path:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/clip-path/lib/props/height/get.js b/components/svg/clip-path/lib/props/height/get.js deleted file mode 100644 index 64bcb89..0000000 --- a/components/svg/clip-path/lib/props/height/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the height. -* -* @private -* @returns {number} height -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._height; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/clip-path/lib/props/height/set.js b/components/svg/clip-path/lib/props/height/set.js deleted file mode 100644 index b937313..0000000 --- a/components/svg/clip-path/lib/props/height/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/height.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:set:height' ); -var CHANGE_EVENT = events( 'height' ); - - -// MAIN // - -/** -* Sets the height. -* -* @private -* @param {PositiveNumber} height - height -* @throws {TypeError} must be a positive number -*/ -function set( height ) { - /* eslint-disable no-invalid-this */ - var err = isValid( height ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._height ); - - this._height = height; - debug( 'New Value: %d.', this._height ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/clip-path/lib/props/id/get.js b/components/svg/clip-path/lib/props/id/get.js deleted file mode 100644 index 1e2aebe..0000000 --- a/components/svg/clip-path/lib/props/id/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the clipping path id. -* -* @private -* @returns {string} id -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._id; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/clip-path/lib/props/id/set.js b/components/svg/clip-path/lib/props/id/set.js deleted file mode 100644 index f85eb4e..0000000 --- a/components/svg/clip-path/lib/props/id/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/id.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:set:id' ); -var CHANGE_EVENT = events( 'id' ); - - -// MAIN // - -/** -* Sets the clipping path id. -* -* @private -* @param {string} id - id -* @throws {TypeError} must be a string -*/ -function set( id ) { - /* eslint-disable no-invalid-this */ - var err = isValid( id ); - if ( err ) { - throw err; - } - debug( 'Current value: %s.', this._id ); - - this._id = id; - debug( 'New value: %s.', this._id ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/clip-path/lib/props/width/get.js b/components/svg/clip-path/lib/props/width/get.js deleted file mode 100644 index cfa5f0e..0000000 --- a/components/svg/clip-path/lib/props/width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the width. -* -* @private -* @returns {number} width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/clip-path/lib/props/width/set.js b/components/svg/clip-path/lib/props/width/set.js deleted file mode 100644 index b0f3a0b..0000000 --- a/components/svg/clip-path/lib/props/width/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/width.js' ); - - -// VARIABLES // - -var debug = logger( 'clippath:set:width' ); -var CHANGE_EVENT = events( 'width' ); - - -// MAIN // - -/** -* Sets the width. -* -* @private -* @param {PositiveNumber} width - width -* @throws {TypeError} must be a positive number -*/ -function set( width ) { - /* eslint-disable no-invalid-this */ - var err = isValid( width ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._width ); - - this._width = width; - debug( 'New value: %d.', this._width ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/clip-path/lib/validate.js b/components/svg/clip-path/lib/validate.js deleted file mode 100644 index 32a4a2d..0000000 --- a/components/svg/clip-path/lib/validate.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {PositiveNumber} [options.width] - width -* @param {PositiveNumber} [options.height] - height -* @param {string} [options.id] - clipping path id -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'width': 400, -* 'height': 400 -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/clip-path/lib/validators/auto_render.js b/components/svg/clip-path/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/clip-path/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/clip-path/lib/validators/height.js b/components/svg/clip-path/lib/validators/height.js deleted file mode 100644 index 82ea73c..0000000 --- a/components/svg/clip-path/lib/validators/height.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `height`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/clip-path/lib/validators/id.js b/components/svg/clip-path/lib/validators/id.js deleted file mode 100644 index 3e14d12..0000000 --- a/components/svg/clip-path/lib/validators/id.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `id`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isString( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'id', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/clip-path/lib/validators/index.js b/components/svg/clip-path/lib/validators/index.js deleted file mode 100644 index b7f5514..0000000 --- a/components/svg/clip-path/lib/validators/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 width = require( './width.js' ); -var height = require( './height.js' ); -var id = require( './id.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'width': width, - 'height': height, - 'id': id, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/clip-path/lib/validators/width.js b/components/svg/clip-path/lib/validators/width.js deleted file mode 100644 index e6d8f77..0000000 --- a/components/svg/clip-path/lib/validators/width.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `width`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isPositiveNumber( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/clip-path/package.json b/components/svg/clip-path/package.json deleted file mode 100644 index 193e75a..0000000 --- a/components/svg/clip-path/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/clip-path", - "version": "0.0.0", - "description": "SVG clipping path.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "clippath", - "clip-path", - "clipping", - "clip", - "path", - "mask", - "component" - ] -} diff --git a/components/svg/defs/README.md b/components/svg/defs/README.md deleted file mode 100644 index 10e8f5c..0000000 --- a/components/svg/defs/README.md +++ /dev/null @@ -1,193 +0,0 @@ - - -# Definitions - -> [SVG][svg] plot definitions. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var Defs = require( '@stdlib/plot/components/svg/defs' ); -``` - -#### Defs() - -Returns a `Defs` instance. - -```javascript -var node = new Defs(); -// returns -``` - -* * * - -### Methods - - - -#### Defs.prototype.render() - -Renders an instance as a [virtual DOM tree][virtual-dom]. - -```javascript -var node = new Defs(); - -var vtree = node.render(); -/* e.g., returns - { - 'tagName': 'defs', - 'properties': { - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } -*/ -``` - -* * * - -### Events - - - -#### 'render' - -Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. - -```javascript -var node = new Defs(); - -function onRender( vtree ) { - console.log( vtree ); -} - -node.on( 'render', onRender ); -node.render(); -``` - -* * * - -### Listeners - - - -#### 'change' - -Upon receiving a `'change'` event, an instance re-renders. - -```javascript -var node = new Defs(); - -function onRender( vtree ) { - console.log( vtree ); -} - -node.on( 'render', onRender ); -node.emit( 'change' ); -``` - -
- - - - - -
- -
- - - - - -* * * - -
- -## Examples - - - -```javascript -var toHTML = require( 'vdom-to-html' ); -var defs = require( '@stdlib/plot/components/svg/defs' ); - -// Create a new component: -var node = defs(); - -// Render as a virtual DOM tree: -var vtree = node.render(); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -// returns -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/components/svg/defs/benchmark/benchmark.js b/components/svg/defs/benchmark/benchmark.js deleted file mode 100644 index 171d46c..0000000 --- a/components/svg/defs/benchmark/benchmark.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 pkg = require( './../package.json' ).name; -var Defs = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var node; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = new Defs(); - if ( !( node instanceof Defs ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Defs ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var node; - var i; - - ctor = Defs; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = ctor(); - if ( !( node instanceof Defs ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Defs ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':render', function benchmark( b ) { - var vtree; - var node; - var i; - - node = new Defs(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - vtree = node.render(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/components/svg/defs/examples/index.js b/components/svg/defs/examples/index.js deleted file mode 100644 index af533f0..0000000 --- a/components/svg/defs/examples/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var defs = require( './../lib' ); - -// Create a new definitions component: -var node = defs(); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); -// => diff --git a/components/svg/defs/lib/index.js b/components/svg/defs/lib/index.js deleted file mode 100644 index 90a888f..0000000 --- a/components/svg/defs/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* SVG plot definitions. -* -* @module @stdlib/plot/components/svg/defs -* -* @example -* var Defs = require( '@stdlib/plot/components/svg/defs' ); -* -* var node = new Defs(); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/defs/lib/main.js b/components/svg/defs/lib/main.js deleted file mode 100644 index 0d29175..0000000 --- a/components/svg/defs/lib/main.js +++ /dev/null @@ -1,112 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var inherit = require( '@stdlib/utils/inherit' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var render = require( './render.js' ); - - -// VARIABLES // - -var debug = logger( 'defs:main' ); - - -// MAIN // - -/** -* SVG definitions constructor. -* -* @constructor -* @returns {Defs} definitions instance -* -* @example -* var node = new Defs(); -* // returns -*/ -function Defs() { - var self; - if ( !instanceOf( this, Defs ) ) { - return new Defs(); - } - self = this; - debug( 'Creating an instance...' ); - EventEmitter.call( this ); - this.on( 'change', onChange ); - this.on( '_render', onRender ); - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - self.render(); - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Inherit from the `EventEmitter` prototype. -*/ -inherit( Defs, EventEmitter ); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Defs.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var node = new Defs(); -* -* var out = node.render(); -* // returns -*/ -setReadOnly( Defs.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Defs; diff --git a/components/svg/defs/lib/render.js b/components/svg/defs/lib/render.js deleted file mode 100644 index c64af49..0000000 --- a/components/svg/defs/lib/render.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'defs:render' ); -var ELEMENT = 'defs'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var vtree; - var props; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg' - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/defs/package.json b/components/svg/defs/package.json deleted file mode 100644 index 9159edd..0000000 --- a/components/svg/defs/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/defs", - "version": "0.0.0", - "description": "SVG plot definitions.", - "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", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "defs", - "definitions", - "component", - "virtual", - "dom", - "vdom", - "virtual-dom" - ] -} diff --git a/components/svg/defs/test/fixtures/vtree.js b/components/svg/defs/test/fixtures/vtree.js deleted file mode 100644 index 220d8d6..0000000 --- a/components/svg/defs/test/fixtures/vtree.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'defs', - 'properties': { - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/defs/test/test.js b/components/svg/defs/test/test.js deleted file mode 100644 index cc1df9e..0000000 --- a/components/svg/defs/test/test.js +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var tape = require( 'tape' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var Defs = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Defs, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is a constructor', function test( t ) { - var node = new Defs(); - t.strictEqual( instanceOf( node, Defs ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` operator', function test( t ) { - var ctor; - var node; - - ctor = Defs; - node = ctor(); - - t.strictEqual( instanceOf( node, Defs ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor returns an event emitter', function test( t ) { - var node = new Defs(); - t.strictEqual( instanceOf( node, EventEmitter ), true, 'is an event emitter' ); - t.end(); -}); - -tape( 'when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var node = new Defs(); - node.on( 'render', onRender ); - node.emit( 'change' ); - - function onRender( obj ) { - t.ok( true, 'emits a render event' ); - t.deepEqual( obj, VTREE, 'provides virtual tree' ); - t.end(); - } -}); - -tape( 'the `render` method returns a rendered virtual tree', function test( t ) { - var vtree; - var node; - - node = new Defs(); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'returns a virtual tree' ); - t.end(); -}); diff --git a/components/svg/graph/examples/index.js b/components/svg/graph/examples/index.js deleted file mode 100644 index 616e8c0..0000000 --- a/components/svg/graph/examples/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var graph = require( './../lib' ); - -// Create a new graph component: -var node = graph({ - 'translateX': 90, - 'translateY': 20, - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -node.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - node.translateX = 80; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/graph/lib/defaults.json b/components/svg/graph/lib/defaults.json deleted file mode 100644 index 983fe36..0000000 --- a/components/svg/graph/lib/defaults.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "translateX": 0, - "translateY": 0, - "autoRender": false -} diff --git a/components/svg/graph/lib/events/events.json b/components/svg/graph/lib/events/events.json deleted file mode 100644 index 54b6080..0000000 --- a/components/svg/graph/lib/events/events.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "translateX": "change", - "translateY": "change", - "autoRender": "change" -} diff --git a/components/svg/graph/lib/events/index.js b/components/svg/graph/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/graph/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/graph/lib/index.js b/components/svg/graph/lib/index.js deleted file mode 100644 index a5e342a..0000000 --- a/components/svg/graph/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Graph component. -* -* @module @stdlib/plot/components/svg/graph -* -* @example -* var Graph = require( '@stdlib/plot/components/svg/graph' ); -* -* var graph = new Graph({ -* 'translateX': 90, -* 'translateY': 20 -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/graph/lib/main.js b/components/svg/graph/lib/main.js deleted file mode 100644 index 7897874..0000000 --- a/components/svg/graph/lib/main.js +++ /dev/null @@ -1,233 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setTranslateX = require( './props/translate-x/set.js' ); -var getTranslateX = require( './props/translate-x/get.js' ); -var setTranslateY = require( './props/translate-y/set.js' ); -var getTranslateY = require( './props/translate-y/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'graph:main' ); - - -// MAIN // - -/** -* Graph constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {NonNegativeInteger} [options.translateX=0] - horizontal translation -* @param {NonNegativeInteger} [options.translateY=0] - vertical translation -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Graph} graph instance -* -* @example -* var graph = new Graph({ -* 'translateX': 90, -* 'translateY': 20 -* }); -*/ -function Graph( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Graph ) ) { - return new Graph( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_translateX', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.translateX - }); - defineProperty( this, '_translateY', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.translateY - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Graph.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Graph.prototype.constructor = Graph; - -/** -* Horizontal translation. -* -* @name translateX -* @memberof Graph.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 0 -* -* @example -* var graph = new Graph({ -* 'translateX': 90 -* }); -* -* var v = graph.translateX; -* // returns 90 -*/ -defineProperty( Graph.prototype, 'translateX', { - 'configurable': false, - 'enumerable': true, - 'set': setTranslateX, - 'get': getTranslateX -}); - -/** -* Vertical translation. -* -* @name translateY -* @memberof Graph.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 0 -* -* @example -* var graph = new Graph({ -* 'translateY': 20 -* }); -* -* var v = graph.translateY; -* // returns 20 -*/ -defineProperty( Graph.prototype, 'translateY', { - 'configurable': false, - 'enumerable': true, - 'set': setTranslateY, - 'get': getTranslateY -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Graph.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var graph = new Graph({ -* 'autoRender': true -* }); -* -* var mode = graph.autoRender; -* // returns true -*/ -defineProperty( Graph.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Graph.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var graph = new Graph(); -* -* var out = graph.render(); -*/ -setReadOnly( Graph.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Graph; diff --git a/components/svg/graph/lib/methods/render.js b/components/svg/graph/lib/methods/render.js deleted file mode 100644 index fcd76b3..0000000 --- a/components/svg/graph/lib/methods/render.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'graph:render' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'graph', - 'className': 'graph', - 'attributes': { - 'transform': 'translate('+this.translateX+','+this.translateY+')' - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/graph/lib/props/auto-render/get.js b/components/svg/graph/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/graph/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/graph/lib/props/auto-render/set.js b/components/svg/graph/lib/props/auto-render/set.js deleted file mode 100644 index 2119176..0000000 --- a/components/svg/graph/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'canvas:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/graph/lib/props/translate-x/get.js b/components/svg/graph/lib/props/translate-x/get.js deleted file mode 100644 index ef5e55c..0000000 --- a/components/svg/graph/lib/props/translate-x/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the horizontal translation. -* -* @private -* @returns {NonNegativeInteger} translation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._translateX; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/graph/lib/props/translate-x/set.js b/components/svg/graph/lib/props/translate-x/set.js deleted file mode 100644 index 49fe20f..0000000 --- a/components/svg/graph/lib/props/translate-x/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/translate_x.js' ); - - -// VARIABLES // - -var debug = logger( 'graph:set:translate-x' ); -var CHANGE_EVENT = events( 'translateX' ); - - -// MAIN // - -/** -* Sets the horizontal translation. -* -* @private -* @param {NonNegativeInteger} v - translation -* @throws {TypeError} must be a nonnegative integer -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var err = isValid( v ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._translateX ); - - this._translateX = v; - debug( 'New Value: %d.', this._translateX ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/graph/lib/props/translate-y/get.js b/components/svg/graph/lib/props/translate-y/get.js deleted file mode 100644 index 5572719..0000000 --- a/components/svg/graph/lib/props/translate-y/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the vertical translation. -* -* @private -* @returns {NonNegativeInteger} translation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._translateY; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/graph/lib/props/translate-y/set.js b/components/svg/graph/lib/props/translate-y/set.js deleted file mode 100644 index e4ce28f..0000000 --- a/components/svg/graph/lib/props/translate-y/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/translate_y.js' ); - - -// VARIABLES // - -var debug = logger( 'graph:set:translate-y' ); -var CHANGE_EVENT = events( 'translateY' ); - - -// MAIN // - -/** -* Sets the vertical translation. -* -* @private -* @param {NonNegativeInteger} v - translation -* @throws {TypeError} must be a nonnegative integer -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var err = isValid( v ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._translateY ); - - this._translateY = v; - debug( 'New Value: %d.', this._translateY ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/graph/lib/validate.js b/components/svg/graph/lib/validate.js deleted file mode 100644 index 97725e3..0000000 --- a/components/svg/graph/lib/validate.js +++ /dev/null @@ -1,84 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {NonNegativeInteger} [options.translateX] - horizontal translation -* @param {NonNegativeInteger} [options.translateY] - vertical translation -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'translateX': 90, -* 'translateY': 20 -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/graph/lib/validators/auto_render.js b/components/svg/graph/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/graph/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/graph/lib/validators/index.js b/components/svg/graph/lib/validators/index.js deleted file mode 100644 index 80a856d..0000000 --- a/components/svg/graph/lib/validators/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 translateX = require( './translate_x.js' ); -var translateY = require( './translate_y.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'translateX': translateX, - 'translateY': translateY, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/graph/lib/validators/translate_x.js b/components/svg/graph/lib/validators/translate_x.js deleted file mode 100644 index 9d9c2b9..0000000 --- a/components/svg/graph/lib/validators/translate_x.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `translateX`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'translateX', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/graph/lib/validators/translate_y.js b/components/svg/graph/lib/validators/translate_y.js deleted file mode 100644 index 523ec57..0000000 --- a/components/svg/graph/lib/validators/translate_y.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `translateY`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isNonNegativeInteger( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'translateY', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/graph/package.json b/components/svg/graph/package.json deleted file mode 100644 index 935a04e..0000000 --- a/components/svg/graph/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/graph", - "version": "0.0.0", - "description": "Graph component.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "component" - ] -} diff --git a/components/svg/marks/examples/index.js b/components/svg/marks/examples/index.js deleted file mode 100644 index 38e827b..0000000 --- a/components/svg/marks/examples/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var marks = require( './../lib' ); - -// Create a new component: -var node = marks({ - 'clipPathId': '1234', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -node.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - node.clipPathId = '4321'; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/marks/lib/defaults.json b/components/svg/marks/lib/defaults.json deleted file mode 100644 index f77788e..0000000 --- a/components/svg/marks/lib/defaults.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "clipPathId": "", - "autoRender": false -} diff --git a/components/svg/marks/lib/events/events.json b/components/svg/marks/lib/events/events.json deleted file mode 100644 index 3496bcb..0000000 --- a/components/svg/marks/lib/events/events.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "clipPathId": "change", - "autoRender": "change" -} diff --git a/components/svg/marks/lib/events/index.js b/components/svg/marks/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/marks/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/marks/lib/index.js b/components/svg/marks/lib/index.js deleted file mode 100644 index cb30562..0000000 --- a/components/svg/marks/lib/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Marks. -* -* @module @stdlib/plot/components/svg/marks -* -* @example -* var Marks = require( '@stdlib/plot/components/svg/marks' ); -* -* var marks = new Marks({ -* 'clipPathId': '1234' -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/marks/lib/main.js b/components/svg/marks/lib/main.js deleted file mode 100644 index c299763..0000000 --- a/components/svg/marks/lib/main.js +++ /dev/null @@ -1,198 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setClipPathId = require( './props/clip-path-id/set.js' ); -var getClipPathId = require( './props/clip-path-id/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'marks:main' ); - - -// MAIN // - -/** -* Marks constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {string} [options.clipPathId] - clipping path id -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Marks} marks instance -* -* @example -* var marks = new Marks({ -* 'clipPathId': '1234' -* }); -*/ -function Marks( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Marks ) ) { - return new Marks( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_clipPathId', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.clipPathId - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Marks.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Marks.prototype.constructor = Marks; - -/** -* Clipping path id. -* -* @name clipPathId -* @memberof Marks.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var marks = new Marks({ -* 'clipPathId': '1234' -* }); -* -* var id = marks.clipPathId; -* // returns '1234' -*/ -defineProperty( Marks.prototype, 'clipPathId', { - 'configurable': false, - 'enumerable': true, - 'set': setClipPathId, - 'get': getClipPathId -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Marks.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var marks = new Marks({ -* 'autoRender': true -* }); -* -* var mode = marks.autoRender; -* // returns true -*/ -defineProperty( Marks.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Marks.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var marks = new Marks(); -* -* var out = marks.render(); -*/ -setReadOnly( Marks.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Marks; diff --git a/components/svg/marks/lib/methods/render.js b/components/svg/marks/lib/methods/render.js deleted file mode 100644 index fb5a1f5..0000000 --- a/components/svg/marks/lib/methods/render.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'marks:render' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'marks', - 'className': 'marks', - 'attributes': { - 'clip-path': 'url(#'+this._clipPathId+')' - } - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/marks/lib/props/auto-render/get.js b/components/svg/marks/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/marks/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/marks/lib/props/auto-render/set.js b/components/svg/marks/lib/props/auto-render/set.js deleted file mode 100644 index 5fd14f6..0000000 --- a/components/svg/marks/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'marks:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/marks/lib/props/clip-path-id/get.js b/components/svg/marks/lib/props/clip-path-id/get.js deleted file mode 100644 index ff6c1a9..0000000 --- a/components/svg/marks/lib/props/clip-path-id/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the clipping path id. -* -* @private -* @returns {string} id -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._clipPathId; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/marks/lib/props/clip-path-id/set.js b/components/svg/marks/lib/props/clip-path-id/set.js deleted file mode 100644 index f0677e3..0000000 --- a/components/svg/marks/lib/props/clip-path-id/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/clip_path_id.js' ); - - -// VARIABLES // - -var debug = logger( 'marks:set:clip-path-id' ); -var CHANGE_EVENT = events( 'clipPathId' ); - - -// MAIN // - -/** -* Sets the clipping path id. -* -* @private -* @param {string} id - clipping path id -* @throws {TypeError} must be a string -*/ -function set( id ) { - /* eslint-disable no-invalid-this */ - var err = isValid( id ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._clipPathId ); - - this._clipPathId = id; - debug( 'New Value: %d.', this._clipPathId ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/marks/lib/validate.js b/components/svg/marks/lib/validate.js deleted file mode 100644 index 1b5e996..0000000 --- a/components/svg/marks/lib/validate.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {string} [options.clipPathId] - clipping path id -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'clipPathId': '1234' -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/marks/lib/validators/auto_render.js b/components/svg/marks/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/marks/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/marks/lib/validators/clip_path_id.js b/components/svg/marks/lib/validators/clip_path_id.js deleted file mode 100644 index ec90d10..0000000 --- a/components/svg/marks/lib/validators/clip_path_id.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `clipPathId`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isString( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'clipPathId', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/marks/lib/validators/index.js b/components/svg/marks/lib/validators/index.js deleted file mode 100644 index c3bab2a..0000000 --- a/components/svg/marks/lib/validators/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 clipPathId = require( './clip_path_id.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'clipPathId': clipPathId, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/marks/package.json b/components/svg/marks/package.json deleted file mode 100644 index 2222359..0000000 --- a/components/svg/marks/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/marks", - "version": "0.0.0", - "description": "Marks.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "marks", - "component" - ] -} diff --git a/components/svg/path/examples/index.js b/components/svg/path/examples/index.js deleted file mode 100644 index b68ee2d..0000000 --- a/components/svg/path/examples/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var path = require( './../lib' ); - -// Create a new path: -var node = path({ - 'x': [0.10, 0.50, 0.90], - 'y': [0.43, 0.37, 0.53], - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -node.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - node.y = [0.99, 0.87, 0.92]; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/path/lib/accessors/is_defined.js b/components/svg/path/lib/accessors/is_defined.js deleted file mode 100644 index fe50ce4..0000000 --- a/components/svg/path/lib/accessors/is_defined.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'path:accessor:is-defined' ); - - -// MAIN // - -/** -* Accessor function which determines whether a datum is defined. -* -* @private -* @param {number} d - datum -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/components/svg/path/lib/defaults.json b/components/svg/path/lib/defaults.json deleted file mode 100644 index a5ca76d..0000000 --- a/components/svg/path/lib/defaults.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "autoRender": false, - "color": "#000", - "isDefined": null, - "label": "", - "opacity": 0.9, - "style": "-", - "width": 2, - "x": [], - "xScale": null, - "y": [], - "yScale": null -} diff --git a/components/svg/path/lib/index.js b/components/svg/path/lib/index.js deleted file mode 100644 index d3797cb..0000000 --- a/components/svg/path/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* SVG path component. -* -* @module @stdlib/plot/components/svg/path -* -* @example -* var Path = require( '@stdlib/plot/components/svg/path' ); -* -* var path = new Path({ -* 'x': [0.1,0.2,0.3], -* 'y': [0.4,0.5,0.6] -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/path/lib/main.js b/components/svg/path/lib/main.js deleted file mode 100644 index d2eaa36..0000000 --- a/components/svg/path/lib/main.js +++ /dev/null @@ -1,541 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: improve JSDoc examples - -// MODULES // - -var EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var format = require( '@stdlib/string/format' ); -var copy = require( '@stdlib/utils/copy' ); -var merge = require( '@stdlib/utils/merge' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var isDefined = require( './accessors/is_defined.js' ); -var defaults = require( './defaults.json' ); -var setX = require( './props/x/set.js' ); -var getX = require( './props/x/get.js' ); -var setY = require( './props/y/set.js' ); -var getY = require( './props/y/get.js' ); -var setXScale = require( './props/x-scale/set.js' ); -var getXScale = require( './props/x-scale/get.js' ); -var setYScale = require( './props/y-scale/set.js' ); -var getYScale = require( './props/y-scale/get.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setColor = require( './props/color/set.js' ); -var getColor = require( './props/color/get.js' ); -var setLabel = require( './props/label/set.js' ); -var getLabel = require( './props/label/get.js' ); -var setOpacity = require( './props/opacity/set.js' ); -var getOpacity = require( './props/opacity/get.js' ); -var setWidth = require( './props/width/set.js' ); -var getWidth = require( './props/width/get.js' ); -var setStyle = require( './props/style/set.js' ); -var getStyle = require( './props/style/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var getLine = require( './props/line/get.js' ); -var getXPos = require( './props/x-pos/get.js' ); -var getYPos = require( './props/y-pos/get.js' ); -var render = require( './render' ); - - -// VARIABLES // - -var debug = logger( 'path:main' ); -var PRIVATE_PROPS = [ - '_autoRender', - '_color', - '_isDefined', - '_label', - '_opacity', - '_style', - '_width', - '_xData', - '_xScale', - '_yData', - '_yScale' -]; - - -// MAIN // - -/** -* Path constructor. -* -* @constructor -* @param {Options} [options] - constructor options -* @param {ArrayLike} [options.x=[]] - x-values -* @param {ArrayLike} [options.y=[]] - y-values -* @param {Function} [options.xScale] - x scale function -* @param {Function} [options.yScale] - y scale function -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.color] - color -* @param {string} [options.label] - label -* @param {NonNegativeInteger} [options.width=2] - width -* @param {number} [options.opacity=0.9] - opacity -* @param {string} [options.style='-'] - style -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Path} Path instance -* -* @example -* var path = new Path({ -* 'x': [0.1,0.2,0.3], -* 'y': [0.4,0.5,0.6] -* }); -*/ -function Path( options ) { - var self; - var keys; - var opts; - var key; - var i; - if ( !( this instanceof Path ) ) { - if ( arguments.length ) { - return new Path( options ); - } - return new Path(); - } - self = this; - - opts = copy( defaults ); - opts.isDefined = isDefined; - opts.xScale = linear(); - opts.yScale = linear(); - - if ( arguments.length ) { - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - opts = merge( opts, options ); - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Path.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Path.prototype.constructor = Path; - -/** -* `x` values. -* -* @name x -* @memberof Path.prototype -* @type {ArrayLike} -* @throws {TypeError} must be array-like -* @default [] -* -* @example -* var path = new Path({ -* 'x': [0.1,0.2,0.3] -* }); -* -* var x = path.x; -* // returns [0.1,0.2,0.3] -*/ -defineProperty( Path.prototype, 'x', { - 'configurable': false, - 'enumerable': true, - 'set': setX, - 'get': getX -}); - -/** -* `y` values. -* -* @name y -* @memberof Path.prototype -* @type {ArrayLike} -* @throws {TypeError} must be array-like -* @default [] -* -* @example -* var path = new Path({ -* 'y': [0.4,0.5,0.6] -* }); -* -* var y = path.y; -* // returns [0.4,0.5,0.6] -*/ -defineProperty( Path.prototype, 'y', { - 'configurable': false, - 'enumerable': true, - 'set': setY, - 'get': getY -}); - -/** -* `x` scale function. -* -* @name xScale -* @memberof Path.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var path = new Path({ -* 'xScale': function scale(){} -* }); -* -* var f = path.xScale; -* // returns -*/ -defineProperty( Path.prototype, 'xScale', { - 'configurable': false, - 'enumerable': true, - 'set': setXScale, - 'get': getXScale -}); - -/** -* `y` scale function. -* -* @name yScale -* @memberof Path.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var path = new Path({ -* 'yScale': function scale(){} -* }); -* -* var f = path.yScale; -* // returns -*/ -defineProperty( Path.prototype, 'yScale', { - 'configurable': false, - 'enumerable': true, - 'set': setYScale, - 'get': getYScale -}); - -/** -* Accessor which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Path.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var path = new Path(); -* path.isDefined = function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* var path = new Path({ -* 'isDefined': isDefined -* }); -* var fcn = path.isDefined; -* // returns -*/ -defineProperty( Path.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* Path color. -* -* @name color -* @memberof Path.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var path = new Path({ -* 'color': 'steelblue' -* }); -* -* var color = path.color; -* // returns 'steelblue' -*/ -defineProperty( Path.prototype, 'color', { - 'configurable': false, - 'enumerable': true, - 'set': setColor, - 'get': getColor -}); - -/** -* Path label. -* -* @name label -* @memberof Path.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var path = new Path({ -* 'label': 'line-1' -* }); -* -* var label = path.label; -* // returns 'line-1' -*/ -defineProperty( Path.prototype, 'label', { - 'configurable': false, - 'enumerable': true, - 'set': setLabel, - 'get': getLabel -}); - -/** -* Path opacity. -* -* @name opacity -* @memberof Path.prototype -* @type {number} -* @throws {TypeError} must be a number -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.9 -* -* @example -* var path = new Path({ -* 'opacity': 0.5 -* }); -* -* var opacity = path.opacity; -* // returns 0.5 -*/ -defineProperty( Path.prototype, 'opacity', { - 'configurable': false, - 'enumerable': true, - 'set': setOpacity, - 'get': getOpacity -}); - -/** -* Path width. -* -* @name width -* @memberof Path.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 2 -* -* @example -* var path = new Path({ -* 'width': 1 -* }); -* -* var width = path.width; -* // returns 1 -*/ -defineProperty( Path.prototype, 'width', { - 'configurable': false, - 'enumerable': true, - 'set': setWidth, - 'get': getWidth -}); - -/** -* Path style. -* -* @name style -* @memberof Path.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default '-' -* -* @example -* var path = new Path({ -* 'style': '-.' -* }); -* -* var style = path.style; -* // returns '-.' -*/ -defineProperty( Path.prototype, 'style', { - 'configurable': false, - 'enumerable': true, - 'set': setStyle, - 'get': getStyle -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Path.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var path = new Path({ -* 'autoRender': true -* }); -* -* var mode = path.autoRender; -* // returns true -*/ -defineProperty( Path.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Returns a function to generate a line as an SVG path. -* -* @name line -* @memberof Path.prototype -* @type {Function} -* -* @example -* var path = new Path(); -* -* var line = path.line; -* // returns -*/ -defineProperty( Path.prototype, 'line', { - 'configurable': false, - 'enumerable': true, - 'get': getLine -}); - -/** -* Function to map values to x coordinate values. -* -* @name xPos -* @memberof Path.prototype -* @type {Function} -* -* @example -* var path = new Path(); -* var xPos = path.xPos; -* // returns -*/ -defineProperty( Path.prototype, 'xPos', { - 'configurable': false, - 'enumerable': true, - 'get': getXPos -}); - -/** -* Function to map values to y coordinate values. -* -* @name yPos -* @memberof Path.prototype -* @type {Function} -* -* @example -* var path = new Path(); -* var yPos = path.yPos; -* // returns -*/ -defineProperty( Path.prototype, 'yPos', { - 'configurable': false, - 'enumerable': true, - 'get': getYPos -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Path.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var path = new Path(); -* -* var out = path.render(); -*/ -setReadOnly( Path.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Path; diff --git a/components/svg/path/lib/props/auto-render/get.js b/components/svg/path/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/path/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/auto-render/set.js b/components/svg/path/lib/props/auto-render/set.js deleted file mode 100644 index 6174175..0000000 --- a/components/svg/path/lib/props/auto-render/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/color/get.js b/components/svg/path/lib/props/color/get.js deleted file mode 100644 index 95da35e..0000000 --- a/components/svg/path/lib/props/color/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the path color. -* -* @private -* @returns {string} color -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._color; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/color/set.js b/components/svg/path/lib/props/color/set.js deleted file mode 100644 index 654fd19..0000000 --- a/components/svg/path/lib/props/color/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:color' ); - - -// MAIN // - -/** -* Sets the path color. -* -* @private -* @param {string} color - color -* @throws {TypeError} must be a string -*/ -function set( color ) { - /* eslint-disable no-invalid-this */ - if ( !isString( color ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'color', color ) ); - } - debug( 'Current value: %d.', this._color ); - - this._color = color; - debug( 'New Value: %d.', this._color ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/is-defined/get.js b/components/svg/path/lib/props/is-defined/get.js deleted file mode 100644 index fd05f22..0000000 --- a/components/svg/path/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the accessor for defined values. -* -* @private -* @returns {Function} accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/is-defined/set.js b/components/svg/path/lib/props/is-defined/set.js deleted file mode 100644 index 3dc6b17..0000000 --- a/components/svg/path/lib/props/is-defined/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:is-defined' ); - - -// MAIN // - -/** -* Sets the accessor for defined values. -* -* @private -* @param {Function} fcn - accessor -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/label/get.js b/components/svg/path/lib/props/label/get.js deleted file mode 100644 index a068a42..0000000 --- a/components/svg/path/lib/props/label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the path label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._label; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/label/set.js b/components/svg/path/lib/props/label/set.js deleted file mode 100644 index 42bb100..0000000 --- a/components/svg/path/lib/props/label/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:label' ); - - -// MAIN // - -/** -* Sets the path label. -* -* @private -* @param {string} label - label -* @throws {TypeError} must be a string -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'label', label ) ); - } - debug( 'Current value: %d.', this._label ); - - this._label = label; - debug( 'New Value: %d.', this._label ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/line/get.js b/components/svg/path/lib/props/line/get.js deleted file mode 100644 index 5e784f1..0000000 --- a/components/svg/path/lib/props/line/get.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 line = require( 'd3-shape' ).line; // TODO: remove - - -// MAIN // - -/** -* Returns a function to generate a line as an SVG path. -* -* @private -* @returns {Function} function to generate a line as an SVG path -*/ -function get() { - /* eslint-disable no-invalid-this, stdlib/empty-line-before-comment */ - var f = line() - .x( this.xPos ) - .y( this.yPos ) - .defined( this.isDefined ); - // TODO: interpolate (curve factory) - // TODO: tension - - return f; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/opacity/get.js b/components/svg/path/lib/props/opacity/get.js deleted file mode 100644 index eea4f9d..0000000 --- a/components/svg/path/lib/props/opacity/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the opacity. -* -* @private -* @returns {number} opacity -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._opacity; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/opacity/set.js b/components/svg/path/lib/props/opacity/set.js deleted file mode 100644 index f4867e8..0000000 --- a/components/svg/path/lib/props/opacity/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:opacity' ); - - -// MAIN // - -/** -* Sets the opacity. -* -* @private -* @param {number} opacity - opacity -* @throws {TypeError} must be a number -* @throws {RangeError} must be a number on the interval `[0,1]` -*/ -function set( opacity ) { - /* eslint-disable no-invalid-this */ - if ( !isNumber( opacity ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', 'opacity', opacity ) ); - } - if ( - opacity < 0.0 || - opacity > 1.0 - ) { - throw new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) ); - } - debug( 'Current value: %d.', this._opacity ); - - this._opacity = opacity; - debug( 'New Value: %d.', this._opacity ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/style/get.js b/components/svg/path/lib/props/style/get.js deleted file mode 100644 index 5329c64..0000000 --- a/components/svg/path/lib/props/style/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the path style. -* -* @private -* @returns {string} style -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._style; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/style/set.js b/components/svg/path/lib/props/style/set.js deleted file mode 100644 index 8c46af5..0000000 --- a/components/svg/path/lib/props/style/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:style' ); - - -// MAIN // - -/** -* Sets the path style. -* -* @private -* @param {string} v - style -* @throws {TypeError} must be a string -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - if ( !isString( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'style', v ) ); - } - debug( 'Current value: %d.', this._style ); - - this._style = v; - debug( 'New Value: %d.', this._style ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/width/get.js b/components/svg/path/lib/props/width/get.js deleted file mode 100644 index b2b8e84..0000000 --- a/components/svg/path/lib/props/width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the width. -* -* @private -* @returns {NonNegativeInteger} width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/width/set.js b/components/svg/path/lib/props/width/set.js deleted file mode 100644 index 73d2ce0..0000000 --- a/components/svg/path/lib/props/width/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:width' ); - - -// MAIN // - -/** -* Sets the width. -* -* @private -* @param {NonNegativeInteger} v - width -* @throws {TypeError} must be a nonnegative integer -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'width', v ) ); - } - debug( 'Current value: %d.', this._width ); - - this._width = v; - debug( 'New Value: %d.', this._width ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/x-pos/get.js b/components/svg/path/lib/props/x-pos/get.js deleted file mode 100644 index a0f8808..0000000 --- a/components/svg/path/lib/props/x-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'path:xpos' ); - - -// MAIN // - -/** -* Returns a function to map values to x coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.xScale; - return xPos; - - /** - * Maps a value to a x coordinate value. - * - * @private - * @param {Array} d - datum - * @returns {number} pixel value - */ - function xPos( d ) { - var px = scale( d[0] ); - debug( 'Value: %d => Pixel: %d.', d[0], px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/x-scale/get.js b/components/svg/path/lib/props/x-scale/get.js deleted file mode 100644 index a3ad33f..0000000 --- a/components/svg/path/lib/props/x-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/x-scale/set.js b/components/svg/path/lib/props/x-scale/set.js deleted file mode 100644 index e9412f5..0000000 --- a/components/svg/path/lib/props/x-scale/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:xscale' ); - - -// MAIN // - -/** -* Sets the x-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xScale', fcn ) ); - } - debug( 'Current value: %s.', this._xScale ); - - this._xScale = fcn; - debug( 'New Value: %s.', this._xScale ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/x/get.js b/components/svg/path/lib/props/x/get.js deleted file mode 100644 index fcddeb2..0000000 --- a/components/svg/path/lib/props/x/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the `x` values. -* -* @private -* @returns {ArrayLike} x values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xData; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/x/set.js b/components/svg/path/lib/props/x/set.js deleted file mode 100644 index 830f7f2..0000000 --- a/components/svg/path/lib/props/x/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:x' ); - - -// MAIN // - -/** -* Sets the `x` values. -* -* @private -* @param {ArrayLike} x - x values -* @throws {TypeError} must be array-like -*/ -function set( x ) { - /* eslint-disable no-invalid-this */ - if ( !isArrayLike( x ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'x', x ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._xData ) ); - - this._xData = x; - debug( 'New Value: %s.', JSON.stringify( this._xData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/y-pos/get.js b/components/svg/path/lib/props/y-pos/get.js deleted file mode 100644 index ea24de7..0000000 --- a/components/svg/path/lib/props/y-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'path:ypos' ); - - -// MAIN // - -/** -* Returns a function to map values to y coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.yScale; - return yPos; - - /** - * Maps a value to a y coordinate value. - * - * @private - * @param {Array} d - datum - * @returns {number} pixel value - */ - function yPos( d ) { - var px = scale( d[1] ); - debug( 'Value: %d => Pixel: %d.', d[1], px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/y-scale/get.js b/components/svg/path/lib/props/y-scale/get.js deleted file mode 100644 index 83f782c..0000000 --- a/components/svg/path/lib/props/y-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/y-scale/set.js b/components/svg/path/lib/props/y-scale/set.js deleted file mode 100644 index df1377f..0000000 --- a/components/svg/path/lib/props/y-scale/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:yscale' ); - - -// MAIN // - -/** -* Sets the y-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yScale', fcn ) ); - } - debug( 'Current value: %s.', this._yScale ); - - this._yScale = fcn; - debug( 'New Value: %s.', this._yScale ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/props/y/get.js b/components/svg/path/lib/props/y/get.js deleted file mode 100644 index 459d022..0000000 --- a/components/svg/path/lib/props/y/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the `y` values. -* -* @private -* @returns {ArrayLike} y values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yData; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/path/lib/props/y/set.js b/components/svg/path/lib/props/y/set.js deleted file mode 100644 index 181b60b..0000000 --- a/components/svg/path/lib/props/y/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'path:set:y' ); - - -// MAIN // - -/** -* Sets the `y` values. -* -* @private -* @param {ArrayLike} y - y values -* @throws {TypeError} must be array-like -*/ -function set( y ) { - /* eslint-disable no-invalid-this */ - if ( !isArrayLike( y ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'y', y ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._yData ) ); - - this._yData = y; - debug( 'New Value: %s.', JSON.stringify( this._yData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/path/lib/render/index.js b/components/svg/path/lib/render/index.js deleted file mode 100644 index 8fd71a9..0000000 --- a/components/svg/path/lib/render/index.js +++ /dev/null @@ -1,77 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var zip = require( './utils/zip.js' ); -var style = require( './utils/style.js' ); - - -// VARIABLES // - -var debug = logger( 'path:render' ); -var ELEMENT = 'path'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'line', - 'className': 'path line', - 'attributes': { - 'd': this.line( zip( this._xData, this._yData ) ), - 'fill': 'none', - 'stroke': this.color, - 'stroke-width': this.width, - 'stroke-opacity': this.opacity, - 'stroke-dasharray': style( this.style ), - 'data-label': this.label - } - }; - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, [] ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/path/lib/render/utils/style.js b/components/svg/path/lib/render/utils/style.js deleted file mode 100644 index cdfee77..0000000 --- a/components/svg/path/lib/render/utils/style.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// VARIABLES // - -var STYLES = { - // Solid path: - '-': '', - - // Dashes: - '--': '5, 1', - - // Dotted path: - ':': '0.9', - - // Dash-dotted path: - '-.': '5, 1, 1, 1' -}; - - -// MAIN // - -/** -* Checks for a known style. If present, returns the [`stroke-dasharray`][1]. Otherwise, returns the provided input value. -* -* [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray -* -* @private -* @param {string} v - style -* @returns {string} stroke dasharray value -*/ -function style( v ) { - var s = STYLES[ v ]; - if ( s ) { - return s; - } - return v; -} - - -// EXPORTS // - -module.exports = style; diff --git a/components/svg/path/lib/render/utils/zip.js b/components/svg/path/lib/render/utils/zip.js deleted file mode 100644 index 7317353..0000000 --- a/components/svg/path/lib/render/utils/zip.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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' ); - - -// MAIN // - -/** -* Zips two arrays. -* -* @private -* @param {ArrayLike} x - x-values -* @param {ArrayLike} y - y-values -* @throws {Error} must provide equal length array-like objects -* @returns {Array} zipped array -*/ -function zip( x, y ) { - var out; - var i; - if ( x.length !== y.length ) { - throw new Error( format( 'invalid arguments. Must provide equal length array-like objects. x length: `%u`. y length: `%u`.', x.length, y.length ) ); - } - out = new Array( x.length ); - for ( i = 0; i < x.length; i++ ) { - out[ i ] = [ x[i], y[i] ]; - } - return out; -} - - -// EXPORTS // - -module.exports = zip; diff --git a/components/svg/path/package.json b/components/svg/path/package.json deleted file mode 100644 index 0933609..0000000 --- a/components/svg/path/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/path", - "version": "0.0.0", - "description": "SVG path.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "path", - "line", - "series", - "component" - ] -} diff --git a/components/svg/rects/lib/props/auto-render/get.js b/components/svg/rects/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/rects/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/auto-render/set.js b/components/svg/rects/lib/props/auto-render/set.js deleted file mode 100644 index 5ec6e51..0000000 --- a/components/svg/rects/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rects:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - if ( bool !== this._autoRender ) { - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rects/lib/props/label/get.js b/components/svg/rects/lib/props/label/get.js deleted file mode 100644 index b7dbfda..0000000 --- a/components/svg/rects/lib/props/label/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a rectangle's label. -* -* @private -* @returns {Function} label accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isString( this._label ) ) { - return label; - } - return this._label; - - /** - * Returns the label. - * - * @private - * @returns {string} label - */ - function label() { - return self._label; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/label/set.js b/components/svg/rects/lib/props/label/set.js deleted file mode 100644 index ea3aa1c..0000000 --- a/components/svg/rects/lib/props/label/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rects:set:label' ); - - -// MAIN // - -/** -* Sets the label. -* -* @private -* @param {(string|Function)} label - label -* @throws {TypeError} must be a string or a function -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) && !isFunction( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'label', label ) ); - } - if ( label !== this._label ) { - debug( 'Current value: %d.', this._label ); - - this._label = label; - debug( 'New Value: %d.', this._label ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rects/lib/props/x-pos/get.js b/components/svg/rects/lib/props/x-pos/get.js deleted file mode 100644 index df38da3..0000000 --- a/components/svg/rects/lib/props/x-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'rects:x-pos' ); - - -// MAIN // - -/** -* Returns a function to map values to `x` coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.xScale; - - return xPos; - /** - * Maps a value to an `x` coordinate value. - * - * @private - * @param {*} d - datum - * @returns {number} pixel value - */ - function xPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/x-scale/get.js b/components/svg/rects/lib/props/x-scale/get.js deleted file mode 100644 index a3ad33f..0000000 --- a/components/svg/rects/lib/props/x-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/x-scale/set.js b/components/svg/rects/lib/props/x-scale/set.js deleted file mode 100644 index 3c21e46..0000000 --- a/components/svg/rects/lib/props/x-scale/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rects:set:xscale' ); - - -// MAIN // - -/** -* Sets the x-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xScale', fcn ) ); - } - if ( fcn !== this._xScale ) { - debug( 'Current value: %s.', this._xScale ); - - this._xScale = fcn; - debug( 'New Value: %s.', this._xScale ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rects/lib/props/y-pos/get.js b/components/svg/rects/lib/props/y-pos/get.js deleted file mode 100644 index 54d127c..0000000 --- a/components/svg/rects/lib/props/y-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'rects:y-pos' ); - - -// MAIN // - -/** -* Returns a function to map values to `y` coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.yScale; - return yPos; - - /** - * Maps a value to a `y` coordinate value. - * - * @private - * @param {*} d - datum - * @returns {number} pixel value - */ - function yPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/y-scale/get.js b/components/svg/rects/lib/props/y-scale/get.js deleted file mode 100644 index 83f782c..0000000 --- a/components/svg/rects/lib/props/y-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rects/lib/props/y-scale/set.js b/components/svg/rects/lib/props/y-scale/set.js deleted file mode 100644 index 5cb1893..0000000 --- a/components/svg/rects/lib/props/y-scale/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rects:set:yscale' ); - - -// MAIN // - -/** -* Sets the y-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yScale', fcn ) ); - } - if ( fcn !== this._yScale ) { - debug( 'Current value: %s.', this._yScale ); - - this._yScale = fcn; - debug( 'New Value: %s.', this._yScale ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rects/lib/render/columns.js b/components/svg/rects/lib/render/columns.js deleted file mode 100644 index d2e51cb..0000000 --- a/components/svg/rects/lib/render/columns.js +++ /dev/null @@ -1,106 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'rects:render:rects' ); -var ELEMENT = 'rect'; - - -// MAIN // - -/** -* Renders data as a rectangles. -* -* @private -* @param {Object} state - state -* @returns {Array} array of virtual trees -*/ -function render( state ) { - var lineOpacity; - var faceOpacity; - var faceColor; - var lineColor; - var label; - var props; - var xPos; - var yPos; - var data; - var out; - var pos; - var x0; - var x1; - var y; - var i; - var j; - - debug( 'Rendering rectangles...' ); - - label = state.label; - lineOpacity = state.lineOpacity; - faceOpacity = state.faceOpacity; - lineColor = state.lineColor; - faceColor = state.faceColor; - xPos = state.xPos; - yPos = state.yPos; - data = state.data; - - out = new Array( data.length/3 ); - for ( i = 0; i < data.length; i += 3 ) { - j = i / 3; - - x0 = data[ i ]; - x1 = data[ i+1 ]; - y = data[ i+2 ]; - - pos = xPos( x0 ); - - debug( 'Rendering datum %d...', j ); - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'column', - 'className': 'column', - 'attributes': { - 'x': pos, - 'width': xPos( x1 ) - pos, - 'height': yPos( y ), // FIXME - 'stroke': lineColor( x0, x1, y, j ), - 'stroke-opacity': lineOpacity( x0, x1, y, j ), - 'fill': faceColor( x0, x1, y, j ), - 'fill-opacity': faceOpacity( x0, x1, y, j ), - 'data-label': label( x0, x1, y, j ) - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - out[ j ] = h( ELEMENT, props, [] ); - } - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/rects/lib/render/index.js b/components/svg/rects/lib/render/index.js deleted file mode 100644 index c6213fb..0000000 --- a/components/svg/rects/lib/render/index.js +++ /dev/null @@ -1,76 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var columns = require( './columns.js' ); -var bars = require( './bars.js' ); - - -// VARIABLES // - -var debug = logger( 'rects:render' ); -var ELEMENT = 'g'; -var RENDER = { - 'vertical': columns, - 'horizontal': bars -}; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var children; - var props; - var vtree; - var f; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'rects', - 'className': 'rects' - }; - f = RENDER[ this.orientation ]; - children = f( this ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, children ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/rug/README.md b/components/svg/rug/README.md deleted file mode 100644 index 7f0ff35..0000000 --- a/components/svg/rug/README.md +++ /dev/null @@ -1,464 +0,0 @@ - - -# Rug - -> [SVG][svg] rug component. - - - -
- - - - - - - -A **rug plot** provides a compact 1-dimensional visualization to supplement higher dimensional plots by displaying a [marginal distribution][marginal-distribution] along one axis. Displaying a [marginal distribution][marginal-distribution] is useful in helping reveal the "shape" of data, especially when visual space is limited. - -
- - - - - -
- -## Usage - -```javascript -var Rug = require( '@stdlib/plot/components/svg/rug' ); -``` - -#### Rug( \[options] ) - -Returns a `Rug` instance. - -```javascript -var node = new Rug(); -// returns -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `'change'` event. Default: `true`. -- **color**: tick (tassel) color. May be either a `string` or a `function`. Default: `'#aaa'`. -- **data**: array-like `object` containing tick data. Default: `[]`. -- **isDefined**: predicate function indicating whether a datum is defined. By default, the function treats `NaN` values as undefined data values. -- **label**: tick (tassel) label. May be either a `string` or a `function`. Default: `''`. -- **opacity**: tick (tassel) opacity. Must be on the interval `[0,1]`. Default: `0.9`. -- **orientation**: rug orientation. Must be either bottom, top, right, or left. Default: `'bottom'`. -- **scale**: scale function which maps data values to coordinates. -- **size**: tick (tassel) size. Default: `6` pixels. - -To specify rug plot options at instantiation, provide an `options` object. - -```javascript -var opts = { - 'data': [ 0.1, 0.3, 0.5 ], - 'color': '#ff0000', - 'label': 'group-1', - 'opacity': 0.7, - 'orientation': 'bottom', - 'size': 5, - 'autoRender': false -}; - -var node = new Rug( opts ); -// returns -``` - -* * * - -### Properties - - - -#### Rug.prototype.autoRender - -**Writable** property which specifies whether an instance re-renders on each `'change'` event. - -```javascript -var node = new Rug({ - 'autoRender': false -}); - -var mode = node.autoRender; -// returns false -``` - - - -#### Rug.prototype.color - -**Writable** property which specifies tick (tassel) color. A color value may be either a `string` or an accessor `function`. - -```javascript -var node = new Rug({ - 'color': 'steelblue' -}); - -var color = node.color; -// returns -``` - -When retrieved, the returned value is always an accessor which accepts two parameters: - -- **d**: datum -- **i**: datum index - - - -#### Rug.prototype.data - -**Writable** property which specifies the tick (tassel) data. - -```javascript -var node = new Rug({ - 'data': [ 0.1, 0.2, 0.3 ] -}); - -var data = node.data; -// returns [ 0.1, 0.2, 0.3 ] -``` - - - -#### Rug.prototype.isDefined( d, i ) - -**Writable** property whose value is a predicate `function` which indicates whether a datum is defined and thus determines how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var node = new Rug({ - 'isDefined': isDefined -}); - -node.isDefined = isDefined; -// returns -``` - -The default function behavior defines `NaN` data values as undefined. - - - -#### Rug.prototype.label - -**Writable** property specifying a tick (tassel) label. A label value may be either a `string` or an accessor `function`. - -```javascript -var node = new Rug({ - 'label': 'group-1' -}); - -var label = node.label; -// returns -``` - -When retrieved, the returned value is always an accessor which accepts two parameters: - -- **d**: datum. -- **i**: datum index. - - - -#### Rug.prototype.opacity - -**Writable** property specifying tick (tassel) opacity. An opacity value may be either a `number` or an accessor `function`. - -```javascript -var node = new Rug({ - 'opacity': 0.5 -}); - -var opacity = node.opacity; -// returns -``` - -When retrieved, the returned value is always an accessor which accepts two parameters: - -- **d**: datum. -- **i**: datum index. - - - -#### Rug.prototype.orientation - -**Writable** property specifying the rug plot orientation. - -```javascript -var node = new Rug({ - 'orientation': 'left' -}); - -var orient = node.orientation; -// returns 'left' -``` - -An orientation may be one of the following values: - -- **bottom**: bottom orientation (default) -- **top**: top orientation -- **left**: left orientation -- **right**: right orientation - - - -#### Rug.prototype.scale - -**Writable** property providing a function which maps data values to coordinate values. - -```javascript -function scale( d, i ) { - console.log( d, i ); - return d; -} - -var node = new Rug({ - 'scale': scale -}); - -var fcn = node.scale; -// returns -``` - - - -#### Rug.prototype.size - -**Writable** property specifying tick (tassel) size. - -```javascript -var node = new Rug({ - 'size': 5 -}); - -var size = node.size; -// returns 5 -``` - -* * * - -### Methods - - - -#### Rug.prototype.render() - -Renders an instance as a [virtual DOM tree][virtual-dom]. - -```javascript -var node = new Rug({ - 'data': [ 0.1 ] -}); - -var vtree = node.render(); -/* e.g., returns - { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } -*/ -``` - -* * * - -### Events - - - -#### 'render' - -Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. - -```javascript -var node = new Rug(); - -function onRender( vtree ) { - console.log( vtree ); -} - -// Attach an event listener: -node.on( 'render', onRender ); - -// Render an instance: -node.render(); -``` - -* * * - -### Listeners - - - -#### 'change' - -If `autoRender` is `true`, upon receiving a `'change'` event, an instance re-renders. - -```javascript -var node = new Rug({ - 'autoRender': true -}); - -function onRender( vtree ) { - console.log( vtree ); -} - -// Attach an event listener: -node.on( 'render', onRender ); - -// Manually trigger a change event: -node.emit( 'change' ); -``` - -
- - - - - -
- -
- - - - - -* * * - -
- -## Examples - - - -```javascript -var toHTML = require( 'vdom-to-html' ); -var rug = require( '@stdlib/plot/components/svg/rug' ); - -// Create a new rug component: -var opts = { - 'data': [ 0.10, 0.50, 0.90 ], - 'orientation': 'bottom' -}; -var r = rug( opts ); - -// Render as a virtual DOM tree: -var vtree = r.render(); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -// returns - -// Listen for 'render' events (e.g., when triggered due to changes in state): -r.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - r.data = [ 0.99, 0.87, 0.92 ]; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/components/svg/rug/benchmark/benchmark.js b/components/svg/rug/benchmark/benchmark.js deleted file mode 100644 index fae7353..0000000 --- a/components/svg/rug/benchmark/benchmark.js +++ /dev/null @@ -1,336 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var Rug = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var node; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = new Rug(); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var node; - var i; - - ctor = Rug; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = ctor(); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var node; - var opts; - var i; - - opts = { - 'autoRender': false, - 'color': '#474747', - 'data': [ 1, 2, 3 ], - 'isDefined': noop, - 'label': 'beep', - 'opacity': 1.0, - 'orientation': 'left', - 'size': 10, - 'scale': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node = new Rug( opts ); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( node instanceof Rug ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var node; - var bool; - var i; - - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.autoRender = !bool; - if ( typeof node.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof node.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:color', function benchmark( b ) { - var values; - var node; - var i; - - values = [ - '#fff', - '#000' - ]; - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.color = values[ i % values.length ]; - if ( typeof node.color !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof node.color !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var node; - var i; - - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.data = [ randu(), randu(), randu() ]; - if ( typeof node.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( node.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var node; - var i; - - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.isDefined = createFcn(); - if ( typeof node.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof node.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var node; - var i; - - values = [ - 'beep', - 'boop' - ]; - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.label = values[ i % values.length ]; - if ( typeof node.label !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof node.label !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:opacity', function benchmark( b ) { - var node; - var i; - - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.opacity = randu(); - if ( typeof node.opacity !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof node.opacity !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:orientation', function benchmark( b ) { - var values; - var node; - var v; - var i; - - values = [ - 'left', - 'right', - 'top', - 'bottom' - ]; - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = values[ i % values.length ]; - node.orientation = v; - if ( node.orientation !== v ) { - b.fail( 'should return set value' ); - } - } - b.toc(); - if ( typeof node.orientation !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:scale', function benchmark( b ) { - var node; - var i; - - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - node.scale = createFcn(); - if ( typeof node.scale !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof node.scale !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:size', function benchmark( b ) { - var values; - var node; - var v; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5, - 6 - ]; - node = new Rug(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = values[ i % values.length ]; - node.size = v; - if ( node.size !== v ) { - b.fail( 'should return set value' ); - } - } - b.toc(); - if ( typeof node.size !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/components/svg/rug/benchmark/benchmark.render.js b/components/svg/rug/benchmark/benchmark.render.js deleted file mode 100644 index e8cf993..0000000 --- a/components/svg/rug/benchmark/benchmark.render.js +++ /dev/null @@ -1,106 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var Rug = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var node; - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = randu(); - } - node = new Rug({ - 'data': x - }); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var vtree; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - x[ x.length-1 ] = randu(); - vtree = node.render(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof vtree !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':render:len='+len, f ); - } -} - -main(); diff --git a/components/svg/rug/examples/index.js b/components/svg/rug/examples/index.js deleted file mode 100644 index d30bc38..0000000 --- a/components/svg/rug/examples/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var rug = require( './../lib' ); - -// Create a new rug component: -var opts = { - 'data': [ 0.10, 0.50, 0.90 ], - 'orientation': 'bottom', - 'autoRender': true -}; -var r = rug( opts ); - -// Render as a virtual DOM tree: -var vtree = r.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); -// => - -// Listen for 'render' events (e.g., when triggered due to changes in state): -r.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - r.data = [ 0.99, 0.87, 0.92 ]; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/rug/lib/accessors/is_defined.js b/components/svg/rug/lib/accessors/is_defined.js deleted file mode 100644 index 72d4dc4..0000000 --- a/components/svg/rug/lib/accessors/is_defined.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'rug:accessor:is-defined' ); - - -// MAIN // - -/** -* Predicate function which returns a boolean indicating whether a datum is defined. -* -* @private -* @param {number} d - datum -* @param {integer} i - index -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/components/svg/rug/lib/defaults.json b/components/svg/rug/lib/defaults.json deleted file mode 100644 index be3c01d..0000000 --- a/components/svg/rug/lib/defaults.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "autoRender": false, - "color": "#aaa", - "data": [], - "isDefined": null, - "label": "", - "opacity": 0.9, - "orientation": "bottom", - "scale": null, - "size": 6 -} diff --git a/components/svg/rug/lib/index.js b/components/svg/rug/lib/index.js deleted file mode 100644 index 8133d0a..0000000 --- a/components/svg/rug/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* SVG rug component. -* -* @module @stdlib/plot/components/svg/rug -* -* @example -* var Rug = require( '@stdlib/plot/components/svg/rug' ); -* -* var node = new Rug({ -* 'data': [ 0.1, 0.2, 0.3 ] -* }); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/rug/lib/main.js b/components/svg/rug/lib/main.js deleted file mode 100644 index a625d7d..0000000 --- a/components/svg/rug/lib/main.js +++ /dev/null @@ -1,445 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var format = require( '@stdlib/string/format' ); -var copy = require( '@stdlib/utils/copy' ); -var merge = require( '@stdlib/utils/merge' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var inherit = require( '@stdlib/utils/inherit' ); -var isDefined = require( './accessors/is_defined.js' ); -var defaults = require( './defaults.json' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var setColor = require( './props/color/set.js' ); -var getColor = require( './props/color/get.js' ); -var setData = require( './props/data/set.js' ); -var getData = require( './props/data/get.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setLabel = require( './props/label/set.js' ); -var getLabel = require( './props/label/get.js' ); -var setOpacity = require( './props/opacity/set.js' ); -var getOpacity = require( './props/opacity/get.js' ); -var setOrientation = require( './props/orientation/set.js' ); -var getOrientation = require( './props/orientation/get.js' ); -var getPos = require( './props/pos/get.js' ); -var setScale = require( './props/scale/set.js' ); -var getScale = require( './props/scale/get.js' ); -var setSize = require( './props/size/set.js' ); -var getSize = require( './props/size/get.js' ); -var render = require( './render' ); - - -// VARIABLES // - -var debug = logger( 'rug:main' ); -var PRIVATE_PROPS = [ - '_autoRender', - '_color', - '_data', - '_isDefined', - '_label', - '_opacity', - '_orientation', - '_scale', - '_size' -]; - - -// MAIN // - -/** -* Rug constructor. -* -* @constructor -* @param {Options} [options] - constructor options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @param {(string|Function)} [options.color="#aaa"] - color -* @param {ArrayLike} [options.data=[]] - data -* @param {Function} [options.isDefined] - predicate function indicating whether a datum is defined -* @param {(string|Function)} [options.label] - label -* @param {(number|Function)} [options.opacity=0.9] - opacity -* @param {string} [options.orientation="bottom"] - orientation -* @param {Function} [options.scale] - scale function -* @param {NonNegativeInteger} [options.size=6] - tick (tassel) size -* @throws {TypeError} options argument must be an object -* @throws {TypeError} must provide valid options -* @returns {Rug} Rug instance -* -* @example -* var node = new Rug({ -* 'data': [ 0.1, 0.2, 0.3 ] -* }); -* // returns -*/ -function Rug( options ) { - var self; - var keys; - var opts; - var key; - var i; - if ( !instanceOf( this, Rug ) ) { - if ( arguments.length ) { - return new Rug( options ); - } - return new Rug(); - } - self = this; - - opts = copy( defaults ); - opts.isDefined = isDefined; - opts.scale = linear(); - - if ( arguments.length ) { - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - opts = merge( opts, options ); - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Inherit from the `EventEmitter` prototype. -*/ -inherit( Rug, EventEmitter ); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Rug.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var node = new Rug({ -* 'autoRender': true -* }); -* -* var mode = node.autoRender; -* // returns true -*/ -defineProperty( Rug.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Tick color. When retrieved, the returned value is a color accessor. -* -* @name color -* @memberof Rug.prototype -* @type {(string|Function)} -* @throws {TypeError} must be a string or function -* -* @example -* var node = new Rug({ -* 'color': 'steelblue' -* }); -* -* var color = node.color; -* // returns -*/ -defineProperty( Rug.prototype, 'color', { - 'configurable': false, - 'enumerable': true, - 'set': setColor, - 'get': getColor -}); - -/** -* Data. -* -* @name data -* @memberof Rug.prototype -* @type {ArrayLike} -* @throws {TypeError} must be array-like -* @default [] -* -* @example -* var node = new Rug({ -* 'data': [ 0.1, 0.2, 0.3 ] -* }); -* -* var data = node.data; -* // returns [ 0.1, 0.2, 0.3 ] -*/ -defineProperty( Rug.prototype, 'data', { - 'configurable': false, - 'enumerable': true, - 'set': setData, - 'get': getData -}); - -/** -* Predicate function which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Rug.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var node = new Rug(); -* -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* node.isDefined = isDefined; -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* var node = new Rug({ -* 'isDefined': isDefined -* }); -* var fcn = node.isDefined; -* // returns -*/ -defineProperty( Rug.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* Tick label. When retrieved, the returned value is a label accessor. -* -* @name label -* @memberof Rug.prototype -* @type {(string|Function)} -* @throws {TypeError} must be a string or function -* -* @example -* var node = new Rug({ -* 'label': 'group-1' -* }); -* -* var label = node.label; -* // returns -*/ -defineProperty( Rug.prototype, 'label', { - 'configurable': false, - 'enumerable': true, - 'set': setLabel, - 'get': getLabel -}); - -/** -* Tick opacity. When retrieved, the returned value is an opacity accessor. -* -* @name opacity -* @memberof Rug.prototype -* @type {number} -* @throws {TypeError} must be a number -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.9 -* -* @example -* var node = new Rug({ -* 'opacity': 0.5 -* }); -* -* var opacity = node.opacity; -* // returns -*/ -defineProperty( Rug.prototype, 'opacity', { - 'configurable': false, - 'enumerable': true, - 'set': setOpacity, - 'get': getOpacity -}); - -/** -* Rug orientation. -* -* @name orientation -* @memberof Rug.prototype -* @type {string} -* @throws {TypeError} must be a supported orientation -* -* @example -* var node = new Rug({ -* 'orientation': 'left' -* }); -* -* var orient = node.orientation; -* // returns 'left' -*/ -defineProperty( Rug.prototype, 'orientation', { - 'configurable': false, - 'enumerable': true, - 'set': setOrientation, - 'get': getOrientation -}); - -/** -* Function to map values to x coordinate values. -* -* @name pos -* @memberof Rug.prototype -* @type {Function} -* -* @example -* var node = new Rug(); -* -* var pos = node.pos; -* // returns -*/ -defineProperty( Rug.prototype, 'pos', { - 'configurable': false, - 'enumerable': true, - 'get': getPos -}); - -/** -* Scale function. -* -* @name scale -* @memberof Rug.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var node = new Rug({ -* 'scale': function scale() {} -* }); -* -* var fcn = node.scale; -* // returns -*/ -defineProperty( Rug.prototype, 'scale', { - 'configurable': false, - 'enumerable': true, - 'set': setScale, - 'get': getScale -}); - -/** -* Tick (tassel) size. -* -* @name size -* @memberof Rug.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 6 -* -* @example -* var node = new Rug({ -* 'size': 5 -* }); -* -* var size = node.size; -* // returns 5 -*/ -defineProperty( Rug.prototype, 'size', { - 'configurable': false, - 'enumerable': true, - 'set': setSize, - 'get': getSize -}); - -/** -* Renders a Virtual DOM tree. -* -* @name render -* @memberof Rug.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var node = new Rug(); -* -* var out = node.render(); -* // returns -*/ -setReadOnly( Rug.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Rug; diff --git a/components/svg/rug/lib/props/auto-render/get.js b/components/svg/rug/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/rug/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/auto-render/set.js b/components/svg/rug/lib/props/auto-render/set.js deleted file mode 100644 index a092686..0000000 --- a/components/svg/rug/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - if ( bool !== this._autoRender ) { - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/color/get.js b/components/svg/rug/lib/props/color/get.js deleted file mode 100644 index cf0aabe..0000000 --- a/components/svg/rug/lib/props/color/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a color. -* -* @private -* @returns {Function} color accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isString( this._color ) ) { - return color; - } - return this._color; - - /** - * Returns a color value. - * - * @private - * @returns {string} color - */ - function color() { - return self._color; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/color/set.js b/components/svg/rug/lib/props/color/set.js deleted file mode 100644 index 0b10619..0000000 --- a/components/svg/rug/lib/props/color/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:color' ); - - -// MAIN // - -/** -* Sets the color. -* -* @private -* @param {(string|Function)} color - color -* @throws {TypeError} must be a string or function -*/ -function set( color ) { - /* eslint-disable no-invalid-this */ - if ( !isString( color ) && !isFunction( color ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'color', color ) ); - } - if ( color !== this._color ) { - debug( 'Current value: %d.', this._color ); - - this._color = color; - debug( 'New Value: %d.', this._color ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/data/get.js b/components/svg/rug/lib/props/data/get.js deleted file mode 100644 index 281803e..0000000 --- a/components/svg/rug/lib/props/data/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data values. -* -* @private -* @returns {ArrayLike} data values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._data; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/data/set.js b/components/svg/rug/lib/props/data/set.js deleted file mode 100644 index 4a1afee..0000000 --- a/components/svg/rug/lib/props/data/set.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:data' ); - - -// MAIN // - -/** -* Sets the data values. -* -* ## Notes -* -* - We always fire a `change` event when set, even if the provided reference is the same, to allow signaling that data values have changed (e.g., a data array has mutated). -* -* @private -* @param {ArrayLike} data - data values -* @throws {TypeError} must be array-like -*/ -function set( data ) { - /* eslint-disable no-invalid-this */ - if ( !isArrayLike( data ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'data', data ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._data ) ); - - this._data = data; - debug( 'New Value: %s.', JSON.stringify( this._data ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/is-defined/get.js b/components/svg/rug/lib/props/is-defined/get.js deleted file mode 100644 index 8d6d744..0000000 --- a/components/svg/rug/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the predicate function for determining whether a value is defined. -* -* @private -* @returns {Function} predicate function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/is-defined/set.js b/components/svg/rug/lib/props/is-defined/set.js deleted file mode 100644 index d6aebbe..0000000 --- a/components/svg/rug/lib/props/is-defined/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:is-defined' ); - - -// MAIN // - -/** -* Sets the predicate function for determining whether a value is defined. -* -* @private -* @param {Function} fcn - predicate function -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - if ( fcn !== this._isDefined ) { - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/label/get.js b/components/svg/rug/lib/props/label/get.js deleted file mode 100644 index 680c572..0000000 --- a/components/svg/rug/lib/props/label/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a label. -* -* @private -* @returns {Function} label accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isString( this._label ) ) { - return label; - } - return this._label; - - /** - * Returns a label. - * - * @private - * @returns {string} label - */ - function label() { - return self._label; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/label/set.js b/components/svg/rug/lib/props/label/set.js deleted file mode 100644 index 98107f6..0000000 --- a/components/svg/rug/lib/props/label/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:label' ); - - -// MAIN // - -/** -* Sets the label. -* -* @private -* @param {(string|Function)} label - label -* @throws {TypeError} must be a string or a function -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) && !isFunction( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'label', label ) ); - } - if ( label !== this._label ) { - debug( 'Current value: %d.', this._label ); - - this._label = label; - debug( 'New Value: %d.', this._label ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/opacity/get.js b/components/svg/rug/lib/props/opacity/get.js deleted file mode 100644 index a6e4591..0000000 --- a/components/svg/rug/lib/props/opacity/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get an opacity. -* -* @private -* @returns {Function} opacity accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isNumber( this._opacity ) ) { - return opacity; - } - return this._opacity; - - /** - * Returns the opacity. - * - * @private - * @returns {number} opacity - */ - function opacity() { - return self._opacity; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/opacity/set.js b/components/svg/rug/lib/props/opacity/set.js deleted file mode 100644 index 03fc2c4..0000000 --- a/components/svg/rug/lib/props/opacity/set.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:opacity' ); - - -// MAIN // - -/** -* Sets the opacity. -* -* @private -* @param {(number|Function)} opacity - opacity -* @throws {TypeError} must be a number or a function -* @throws {RangeError} must be a number on the interval `[0,1]` -*/ -function set( opacity ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( opacity ); - if ( !isNum && !isFunction( opacity ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or a function. Value: `%s`.', 'opacity', opacity ) ); - } - if ( isNum && (opacity !== opacity || opacity < 0.0 || opacity > 1.0) ) { - throw new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) ); - } - if ( opacity !== this._opacity ) { - debug( 'Current value: %d.', this._opacity ); - - this._opacity = opacity; - debug( 'New Value: %d.', this._opacity ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/orientation/get.js b/components/svg/rug/lib/props/orientation/get.js deleted file mode 100644 index 2067d1d..0000000 --- a/components/svg/rug/lib/props/orientation/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the orientation. -* -* @private -* @returns {string} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._orientation; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/orientation/orientations.json b/components/svg/rug/lib/props/orientation/orientations.json deleted file mode 100644 index c3d57be..0000000 --- a/components/svg/rug/lib/props/orientation/orientations.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "bottom", - "left", - "right", - "top" -] diff --git a/components/svg/rug/lib/props/orientation/set.js b/components/svg/rug/lib/props/orientation/set.js deleted file mode 100644 index 4fe7468..0000000 --- a/components/svg/rug/lib/props/orientation/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './orientations.json' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:orientation' ); - - -// MAIN // - -/** -* Sets the orientation. -* -* @private -* @param {string} orient - orientation -* @throws {TypeError} must be a supported orientation -*/ -function set( orient ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( ORIENTATIONS, orient ) === -1 ) { - throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), orient ) ); - } - if ( orient !== this._orientation ) { - debug( 'Current value: %d.', this._orientation ); - - this._orientation = orient; - debug( 'New Value: %d.', this._orientation ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/pos/get.js b/components/svg/rug/lib/props/pos/get.js deleted file mode 100644 index 3fd54c4..0000000 --- a/components/svg/rug/lib/props/pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'rug:pos' ); - - -// MAIN // - -/** -* Returns a function to map values to coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.scale; - return pos; - - /** - * Maps a value to a coordinate value. - * - * @private - * @param {*} d - datum - * @returns {number} pixel value - */ - function pos( d ) { - var p = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, p ); - return p; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/scale/get.js b/components/svg/rug/lib/props/scale/get.js deleted file mode 100644 index 4ef9bb2..0000000 --- a/components/svg/rug/lib/props/scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._scale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/scale/set.js b/components/svg/rug/lib/props/scale/set.js deleted file mode 100644 index 8beb12d..0000000 --- a/components/svg/rug/lib/props/scale/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:scale' ); - - -// MAIN // - -/** -* Sets the scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'scale', fcn ) ); - } - if ( fcn !== this._scale ) { - debug( 'Current value: %s.', this._scale ); - - this._scale = fcn; - debug( 'New Value: %s.', this._scale ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/props/size/get.js b/components/svg/rug/lib/props/size/get.js deleted file mode 100644 index b4c45e1..0000000 --- a/components/svg/rug/lib/props/size/get.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 the tick (tassel) size. -* -* @private -* @returns {NonNegativeInteger} tick size -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._size; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/rug/lib/props/size/set.js b/components/svg/rug/lib/props/size/set.js deleted file mode 100644 index 8db6c48..0000000 --- a/components/svg/rug/lib/props/size/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'rug:set:size' ); - - -// MAIN // - -/** -* Sets the tick (tassel) size. -* -* @private -* @param {NonNegativeInteger} size - size -* @throws {TypeError} must be a nonnegative integer -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( size ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'size', size ) ); - } - if ( size !== this._size ) { - debug( 'Current value: %d.', this._size ); - - this._size = size; - debug( 'New Value: %d.', this._size ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/rug/lib/render/index.js b/components/svg/rug/lib/render/index.js deleted file mode 100644 index 44b2517..0000000 --- a/components/svg/rug/lib/render/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var ticks = require( './ticks.js' ); - - -// VARIABLES // - -var debug = logger( 'rug:render' ); -var ELEMENT = 'g'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var children; - var props; - var vtree; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'rug', - 'className': 'rug' - }; - - children = ticks( this ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, children ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/rug/lib/render/ticks.js b/components/svg/rug/lib/render/ticks.js deleted file mode 100644 index 19bbfe0..0000000 --- a/components/svg/rug/lib/render/ticks.js +++ /dev/null @@ -1,103 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var xAttr = require( './utils/x_attr.js' ); -var yAttr = require( './utils/y_attr.js' ); -var tickDir = require( './utils/tick_dir.js' ); - - -// VARIABLES // - -var debug = logger( 'rug:render:ticks' ); -var ELEMENT = 'line'; - - -// MAIN // - -/** -* Renders rug ticks (tassels). -* -* @private -* @param {Object} ctx - context -* @returns {Array} array of virtual trees -*/ -function render( ctx ) { - var props; - var data; - var out; - var pos; - var dir; - var p; - var x; - var y; - var d; - var i; - - debug( 'Rendering ticks...' ); - - data = ctx.data; - pos = ctx.pos; - x = xAttr( ctx.orientation ); - y = yAttr( ctx.orientation ); - dir = tickDir( ctx.orientation ); - - out = new Array( data.length ); - for ( i = 0; i < data.length; i++ ) { - d = data[ i ]; - if ( !ctx.isDefined( d, i ) ) { - debug( 'Datum %d is not defined. Value: %s.', i, d ); - continue; - } - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': ctx.opacity( d, i ), - 'stroke': ctx.color( d, i ), - 'stroke-width': 1, - 'data-label': ctx.label( d, i ) - } - }; - - p = pos( d ); - props.attributes[ x+'1' ] = 0; - props.attributes[ x+'2' ] = dir * ctx.size; - props.attributes[ y+'1' ] = p; - props.attributes[ y+'2' ] = p; - - debug( 'Rendering tick %d with value %s...', i, d ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - out[ i ] = h( ELEMENT, props, [] ); - } - debug( 'Finished rendering ticks.' ); - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/rug/lib/render/utils/tick_dir.js b/components/svg/rug/lib/render/utils/tick_dir.js deleted file mode 100644 index 60ef706..0000000 --- a/components/svg/rug/lib/render/utils/tick_dir.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the tick direction. -* -* @private -* @param {string} orient - orientation -* @returns {number} tick direction -*/ -function tickDir( orient ) { - if ( orient === 'bottom' || orient === 'right' ) { - return -1; - } - return 1; -} - - -// EXPORTS // - -module.exports = tickDir; diff --git a/components/svg/rug/lib/render/utils/x_attr.js b/components/svg/rug/lib/render/utils/x_attr.js deleted file mode 100644 index 8a7ec9f..0000000 --- a/components/svg/rug/lib/render/utils/x_attr.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the "x" attribute for tick positioning. -* -* @private -* @param {string} orient - rug orientation -* @returns {string} attribute -*/ -function xAttr( orient ) { - if ( orient === 'left' || orient === 'right' ) { - return 'x'; - } - return 'y'; -} - - -// EXPORTS // - -module.exports = xAttr; diff --git a/components/svg/rug/lib/render/utils/y_attr.js b/components/svg/rug/lib/render/utils/y_attr.js deleted file mode 100644 index e43b628..0000000 --- a/components/svg/rug/lib/render/utils/y_attr.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the "y" attribute for tick positioning. -* -* @private -* @param {string} orient - rug orientation -* @returns {string} attribute -*/ -function yAttr( orient ) { - if ( orient === 'left' || orient === 'right' ) { - return 'y'; - } - return 'x'; -} - - -// EXPORTS // - -module.exports = yAttr; diff --git a/components/svg/rug/package.json b/components/svg/rug/package.json deleted file mode 100644 index 18048f2..0000000 --- a/components/svg/rug/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/rug", - "version": "0.0.0", - "description": "SVG rug component.", - "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", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "rug", - "density", - "component", - "vdom", - "virtual", - "dom", - "virtual-dom" - ] -} diff --git a/components/svg/rug/srv/scripts/fig_into_plot.js b/components/svg/rug/srv/scripts/fig_into_plot.js deleted file mode 100644 index c4eaa15..0000000 --- a/components/svg/rug/srv/scripts/fig_into_plot.js +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Plot = require( './../../../../../ctor' ); - - -// MAIN // - -/** -* Generates a plot. -* -* @private -*/ -function main() { - var html; - var plot; - var opts; - var x1; - var x2; - var y1; - var y2; - var i; - - // Create some data... - x1 = new Float64Array( 1000 ); - x2 = new Float64Array( x1.length ); - y1 = new Float64Array( x1.length ); - y2 = new Float32Array( x1.length ); - for ( i = 0; i < x1.length; i++ ) { - x1[ i ] = 30.0 + (7.5*randn()); - x2[ i ] = 40.0 + (12.5*randn()); - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 30.0 + (5.0*randn()); - } - - // Define the plot options: - opts = { - 'width': 600, - 'height': 480, - 'xMin': 0.0, - 'xMax': 100.0, - 'yMin': 0.0, - 'yMax': 100.0, - 'lineStyle': 'none', - 'symbols': 'closed-circle', - 'symbolsSize': 6, - 'symbolsOpacity': 0.2, - 'xRug': true, - 'yRug': true, - 'xRugOrient': 'top', - 'yRugOrient': 'right' - }; - - // Create a new plot: - plot = new Plot( [ x1, x2 ], [ y1, y2 ], opts ); - - // Render as HTML/SVG: - html = plot.render( 'html' ); - - // Write to `stdout`: - console.log( html ); -} - -main(); diff --git a/components/svg/rug/test/fixtures/vtree.color_function.js b/components/svg/rug/test/fixtures/vtree.color_function.js deleted file mode 100644 index a2448ee..0000000 --- a/components/svg/rug/test/fixtures/vtree.color_function.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#ffa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#ffb', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#ffc', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.color_string.js b/components/svg/rug/test/fixtures/vtree.color_string.js deleted file mode 100644 index 1517695..0000000 --- a/components/svg/rug/test/fixtures/vtree.color_string.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#fff', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#fff', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#fff', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.data.js b/components/svg/rug/test/fixtures/vtree.data.js deleted file mode 100644 index 6ea06b0..0000000 --- a/components/svg/rug/test/fixtures/vtree.data.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.15, - 'x2': 0.15 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.55, - 'x2': 0.55 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.95, - 'x2': 0.95 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.is_defined.js b/components/svg/rug/test/fixtures/vtree.is_defined.js deleted file mode 100644 index decb1a6..0000000 --- a/components/svg/rug/test/fixtures/vtree.is_defined.js +++ /dev/null @@ -1,98 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 2, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.js b/components/svg/rug/test/fixtures/vtree.js deleted file mode 100644 index 8cc704c..0000000 --- a/components/svg/rug/test/fixtures/vtree.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.label_function.js b/components/svg/rug/test/fixtures/vtree.label_function.js deleted file mode 100644 index 4d0e834..0000000 --- a/components/svg/rug/test/fixtures/vtree.label_function.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'beep', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'boop', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'bop', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.label_string.js b/components/svg/rug/test/fixtures/vtree.label_string.js deleted file mode 100644 index 94c5b74..0000000 --- a/components/svg/rug/test/fixtures/vtree.label_string.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'beep', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'beep', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': 'beep', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.opacity_function.js b/components/svg/rug/test/fixtures/vtree.opacity_function.js deleted file mode 100644 index d895e45..0000000 --- a/components/svg/rug/test/fixtures/vtree.opacity_function.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.25, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.5, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.75, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.opacity_number.js b/components/svg/rug/test/fixtures/vtree.opacity_number.js deleted file mode 100644 index 764d6e7..0000000 --- a/components/svg/rug/test/fixtures/vtree.opacity_number.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.1, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.1, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.1, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.orientation_left.js b/components/svg/rug/test/fixtures/vtree.orientation_left.js deleted file mode 100644 index cf3bf59..0000000 --- a/components/svg/rug/test/fixtures/vtree.orientation_left.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': 6, - 'y1': 0.1, - 'y2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': 6, - 'y1': 0.5, - 'y2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': 6, - 'y1': 0.9, - 'y2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.orientation_right.js b/components/svg/rug/test/fixtures/vtree.orientation_right.js deleted file mode 100644 index 083bff6..0000000 --- a/components/svg/rug/test/fixtures/vtree.orientation_right.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': -6, - 'y1': 0.1, - 'y2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': -6, - 'y1': 0.5, - 'y2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'x1': 0, - 'x2': -6, - 'y1': 0.9, - 'y2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.orientation_top.js b/components/svg/rug/test/fixtures/vtree.orientation_top.js deleted file mode 100644 index 7f7d211..0000000 --- a/components/svg/rug/test/fixtures/vtree.orientation_top.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': 6, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': 6, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': 6, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.scale.js b/components/svg/rug/test/fixtures/vtree.scale.js deleted file mode 100644 index 3934d43..0000000 --- a/components/svg/rug/test/fixtures/vtree.scale.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 1.0, - 'x2': 1.0 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 5.0, - 'x2': 5.0 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -6, - 'x1': 9.0, - 'x2': 9.0 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/fixtures/vtree.size.js b/components/svg/rug/test/fixtures/vtree.size.js deleted file mode 100644 index 91d52ce..0000000 --- a/components/svg/rug/test/fixtures/vtree.size.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // - -var vtree = { - 'tagName': 'g', - 'properties': { - 'property': 'rug', - 'className': 'rug', - 'namespace': void 0 - }, - 'children': [ - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -12, - 'x1': 0.1, - 'x2': 0.1 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -12, - 'x1': 0.5, - 'x2': 0.5 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - }, - { - 'tagName': 'line', - 'properties': { - 'property': 'rug.tick', - 'className': 'tick', - 'attributes': { - 'fill': 'none', - 'opacity': 0.9, - 'stroke': '#aaa', - 'stroke-width': 1, - 'data-label': '', - 'y1': 0, - 'y2': -12, - 'x1': 0.9, - 'x2': 0.9 - }, - 'namespace': void 0 - }, - 'children': [], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 0, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 - } - ], - 'namespace': 'http://www.w3.org/2000/svg', - 'count': 3, - 'hasWidgets': false, - 'hasThunks': false, - 'descendantHooks': false, - 'hooks': void 0, - 'key': void 0 -}; - - -// EXPORTS // - -module.exports = vtree; diff --git a/components/svg/rug/test/test.auto_render.js b/components/svg/rug/test/test.auto_render.js deleted file mode 100644 index 3cf3f17..0000000 --- a/components/svg/rug/test/test.auto_render.js +++ /dev/null @@ -1,172 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false - }); - t.strictEqual( node.autoRender, false, 'returns expected value' ); - - node.autoRender = true; - t.strictEqual( node.autoRender, true, 'returns expected value' ); - - node.autoRender = false; - t.strictEqual( node.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var node = ctor({ - 'autoRender': true, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - node.on( 'render', onRender ); - node.emit( 'change' ); - - function onRender( obj ) { - t.ok( true, 'emits a render event' ); - t.deepEqual( obj, VTREE, 'provides virtual tree' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - node.on( 'render', onRender ); - node.emit( 'change' ); - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': true - }); - node.on( 'change', onChange ); - node.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false - }); - node.on( 'change', onChange ); - node.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': true - }); - node.on( 'change', onChange ); - node.autoRender = true; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false - }); - node.on( 'change', onChange ); - node.autoRender = false; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/components/svg/rug/test/test.color.js b/components/svg/rug/test/test.color.js deleted file mode 100644 index 2dcf0f6..0000000 --- a/components/svg/rug/test/test.color.js +++ /dev/null @@ -1,294 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_COLOR_STRING = require( './fixtures/vtree.color_string.js' ); -var VTREE_COLOR_FCN = require( './fixtures/vtree.color_function.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `color` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.color = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value (string)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#abc' - }); - t.strictEqual( node.color(), '#abc', 'returns expected value' ); - - node.color = '#cba'; - t.strictEqual( node.color(), '#cba', 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance supports setting and getting the property value (function)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'color': color1 - }); - t.strictEqual( node.color, color1, 'returns expected value' ); - - node.color = color2; - t.strictEqual( node.color, color2, 'returns expected value' ); - - t.end(); - - function color1() { - // no-op... - } - - function color2() { - // no-op... - } -}); - -tape( 'a color function is provided two arguments: datum and index', function test( t ) { - var expected; - var actual; - var node; - - node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'color': color, - 'autoRender': false - }); - - expected = [ - [ 0.10, 0 ], - [ 0.50, 1 ], - [ 0.90, 2 ] - ]; - actual = []; - - node.render(); - - t.deepEqual( actual, expected, 'provides expected arguments' ); - t.end(); - - function color( d, i ) { - actual.push( [ d, i ] ); - } -}); - -tape( 'setting the `color` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'color': '#aaa' - }); - node.on( 'change', onChange ); - node.color = '#fff'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `color` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'color': '#aaa' - }); - node.on( 'change', onChange ); - node.color = color; - - function color() { - return '#fff'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `color` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'color': color - }); - node.on( 'change', onChange ); - node.color = '#aaa'; - - function color() { - return '#fff'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `color` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'color': color1 - }); - node.on( 'change', onChange ); - node.color = color2; - - function color1() { - return '#fff'; - } - - function color2() { - return '#aaa'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `color` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'color': '#aaa' - }); - node.on( 'change', onChange ); - node.color = '#aaa'; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `color` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'color': color - }); - node.on( 'change', onChange ); - node.color = color; - t.pass( 'is ok' ); - t.end(); - - function color() { - return '#fff'; - } - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value of the color property determines the tick (tassel) color (string)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.color = '#fff'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_COLOR_STRING, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the color property determines the tick (tassel) color (function)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.color = color; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_COLOR_FCN, 'expected virtual tree' ); - t.end(); - - function color( d ) { - if ( d === 0.10 ) { - return '#ffa'; - } - if ( d === 0.50 ) { - return '#ffb'; - } - return '#ffc'; - } -}); diff --git a/components/svg/rug/test/test.data.js b/components/svg/rug/test/test.data.js deleted file mode 100644 index fb29b52..0000000 --- a/components/svg/rug/test/test.data.js +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_DATA = require( './fixtures/vtree.data.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'data': [ 0.10, 0.50, 0.90 ] - }); - t.deepEqual( node.data, [ 0.10, 0.50, 0.90 ], 'returns expected value' ); - - node.data = [ 0.15, 0.55, 0.95 ]; - t.deepEqual( node.data, [ 0.15, 0.55, 0.95 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false, - 'data': [ 0.10, 0.50, 0.90 ] - }); - node.on( 'change', onChange ); - node.data = [ 0.10, 0.50, 0.90 ]; // new reference - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `data` property to an existing value triggers a `change` event', function test( t ) { - var node; - var data; - - data = [ 0.10, 0.50, 0.90 ]; - node = ctor({ - 'autoRender': false, - 'data': data - }); - node.on( 'change', onChange ); - node.data = data; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'the value of the `data` property determines the tick (tassel) location', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.data = [ 0.15, 0.55, 0.95 ]; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_DATA, 'expected virtual tree' ); - t.end(); -}); diff --git a/components/svg/rug/test/test.is_defined.js b/components/svg/rug/test/test.is_defined.js deleted file mode 100644 index 6475cf0..0000000 --- a/components/svg/rug/test/test.is_defined.js +++ /dev/null @@ -1,193 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_IS_DEFINED = require( './fixtures/vtree.is_defined.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'isDefined': isDefined1 - }); - t.deepEqual( node.isDefined, isDefined1, 'returns expected value' ); - - node.isDefined = isDefined2; - t.deepEqual( node.isDefined, isDefined2, 'returns expected value' ); - - t.end(); - - function isDefined1() { - // no-op... - } - - function isDefined2() { - // no-op... - } -}); - -tape( 'an accessor function is provided two arguments: datum and index', function test( t ) { - var expected; - var actual; - var node; - - node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'isDefined': isDefined, - 'autoRender': false - }); - - expected = [ - [ 0.10, 0 ], - [ 0.50, 1 ], - [ 0.90, 2 ] - ]; - actual = []; - - node.render(); - - t.deepEqual( actual, expected, 'provides expected arguments' ); - t.end(); - - function isDefined( d, i ) { - actual.push( [ d, i ] ); - } -}); - -tape( 'setting the `isDefined` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false, - 'isDefined': isDefined1 - }); - node.on( 'change', onChange ); - node.isDefined = isDefined2; - - function isDefined1() { - // no-op... - } - - function isDefined2() { - // no-op... - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false, - 'isDefined': isDefined - }); - node.on( 'change', onChange ); - node.isDefined = isDefined; - t.pass( 'is ok' ); - t.end(); - - function isDefined() { - // no-op... - } - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value returned by the `isDefined` accessor determines whether a tick is rendered', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'isDefined': isDefined1, - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.isDefined = isDefined2; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_IS_DEFINED, 'expected virtual tree' ); - t.end(); - - function isDefined1( d ) { - return ( d === d ); - } - - function isDefined2( d ) { - return ( d !== 0.50 ); - } -}); diff --git a/components/svg/rug/test/test.js b/components/svg/rug/test/test.js deleted file mode 100644 index 2e3ace3..0000000 --- a/components/svg/rug/test/test.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var tape = require( 'tape' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var Rug = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Rug, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is a constructor', function test( t ) { - var node = new Rug(); - t.strictEqual( instanceOf( node, Rug ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` operator', function test( t ) { - var ctor; - var node; - - ctor = Rug; - node = ctor(); - - t.strictEqual( instanceOf( node, Rug ), true, 'is an instance' ); - t.end(); -}); - -tape( 'the returned instance is an event emitter', function test( t ) { - var node = new Rug(); - t.strictEqual( instanceOf( node, EventEmitter ), true, 'is an event emitter' ); - t.end(); -}); diff --git a/components/svg/rug/test/test.label.js b/components/svg/rug/test/test.label.js deleted file mode 100644 index b8e46a1..0000000 --- a/components/svg/rug/test/test.label.js +++ /dev/null @@ -1,294 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_LABEL_STRING = require( './fixtures/vtree.label_string.js' ); -var VTREE_LABEL_FCN = require( './fixtures/vtree.label_function.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value (string)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'label': 'beep' - }); - t.strictEqual( node.label(), 'beep', 'returns expected value' ); - - node.label = 'boop'; - t.strictEqual( node.label(), 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance supports setting and getting the property value (function)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'label': label1 - }); - t.strictEqual( node.label, label1, 'returns expected value' ); - - node.label = label2; - t.strictEqual( node.label, label2, 'returns expected value' ); - - t.end(); - - function label1() { - // no-op... - } - - function label2() { - // no-op... - } -}); - -tape( 'a label function is provided two arguments: datum and index', function test( t ) { - var expected; - var actual; - var node; - - node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'label': label, - 'autoRender': false - }); - - expected = [ - [ 0.10, 0 ], - [ 0.50, 1 ], - [ 0.90, 2 ] - ]; - actual = []; - - node.render(); - - t.deepEqual( actual, expected, 'provides expected arguments' ); - t.end(); - - function label( d, i ) { - actual.push( [ d, i ] ); - } -}); - -tape( 'setting the `label` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'label': 'beep' - }); - node.on( 'change', onChange ); - node.label = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'label': 'beep' - }); - node.on( 'change', onChange ); - node.label = label; - - function label() { - return 'boop'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'label': label - }); - node.on( 'change', onChange ); - node.label = 'boop'; - - function label() { - return 'beep'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'label': label1 - }); - node.on( 'change', onChange ); - node.label = label2; - - function label1() { - return 'beep'; - } - - function label2() { - return 'boop'; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'label': 'beep' - }); - node.on( 'change', onChange ); - node.label = 'beep'; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `label` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'label': label - }); - node.on( 'change', onChange ); - node.label = label; - t.pass( 'is ok' ); - t.end(); - - function label() { - return 'beep'; - } - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value of the label property determines the tick data label (string)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.label = 'beep'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_LABEL_STRING, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the label property determines the tick data label (function)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.label = label; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_LABEL_FCN, 'expected virtual tree' ); - t.end(); - - function label( d ) { - if ( d === 0.10 ) { - return 'beep'; - } - if ( d === 0.50 ) { - return 'boop'; - } - return 'bop'; - } -}); diff --git a/components/svg/rug/test/test.opacity.js b/components/svg/rug/test/test.opacity.js deleted file mode 100644 index 4fc5a55..0000000 --- a/components/svg/rug/test/test.opacity.js +++ /dev/null @@ -1,314 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_OPACITY_NUM = require( './fixtures/vtree.opacity_number.js' ); -var VTREE_OPACITY_FCN = require( './fixtures/vtree.opacity_function.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `opacity` value', function test( t ) { - var values; - var i; - - values = [ - '5', - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.opacity = value; - }; - } -}); - -tape( 'an instance throws a range error if provided an `opacity` value which is not on the interval `[0,1]`', function test( t ) { - var values; - var i; - - values = [ - -3.14, - 3.14, - NaN - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.opacity = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value (number)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'opacity': 0.9 - }); - t.strictEqual( node.opacity(), 0.9, 'returns expected value' ); - - node.opacity = 0.5; - t.strictEqual( node.opacity(), 0.5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance supports setting and getting the property value (function)', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'opacity': opacity1 - }); - t.strictEqual( node.opacity, opacity1, 'returns expected value' ); - - node.opacity = opacity2; - t.strictEqual( node.opacity, opacity2, 'returns expected value' ); - - t.end(); - - function opacity1() { - // no-op... - } - - function opacity2() { - // no-op... - } -}); - -tape( 'an opacity function is provided two arguments: datum and index', function test( t ) { - var expected; - var actual; - var node; - - node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'opacity': opacity, - 'autoRender': false - }); - - expected = [ - [ 0.10, 0 ], - [ 0.50, 1 ], - [ 0.90, 2 ] - ]; - actual = []; - - node.render(); - - t.deepEqual( actual, expected, 'provides expected arguments' ); - t.end(); - - function opacity( d, i ) { - actual.push( [ d, i ] ); - } -}); - -tape( 'setting the `opacity` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'opacity': 0.9 - }); - node.on( 'change', onChange ); - node.opacity = 0.1; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `opacity` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'opacity': 0.9 - }); - node.on( 'change', onChange ); - node.opacity = opacity; - - function opacity() { - return 0.1; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `opacity` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'opacity': opacity - }); - node.on( 'change', onChange ); - node.opacity = 0.9; - - function opacity() { - return 0.1; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `opacity` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'opacity': opacity1 - }); - node.on( 'change', onChange ); - node.opacity = opacity2; - - function opacity1() { - return 0.9; - } - - function opacity2() { - return 0.1; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `opacity` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'opacity': 0.9 - }); - node.on( 'change', onChange ); - node.opacity = 0.9; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `opacity` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'opacity': opacity - }); - node.on( 'change', onChange ); - node.opacity = opacity; - t.pass( 'is ok' ); - t.end(); - - function opacity() { - return 0.9; - } - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value of the `opacity` property determines the tick (tassel) opacity (number)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.opacity = 0.1; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_OPACITY_NUM, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the `opacity` property determines the tick (tassel) opacity (function)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.opacity = opacity; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_OPACITY_FCN, 'expected virtual tree' ); - t.end(); - - function opacity( d ) { - if ( d === 0.10 ) { - return 0.25; - } - if ( d === 0.50 ) { - return 0.5; - } - return 0.75; - } -}); diff --git a/components/svg/rug/test/test.orientation.js b/components/svg/rug/test/test.orientation.js deleted file mode 100644 index be1b1e9..0000000 --- a/components/svg/rug/test/test.orientation.js +++ /dev/null @@ -1,219 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_ORIENTATION_TOP = require( './fixtures/vtree.orientation_top.js' ); -var VTREE_ORIENTATION_RIGHT = require( './fixtures/vtree.orientation_right.js' ); -var VTREE_ORIENTATION_LEFT = require( './fixtures/vtree.orientation_left.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `orientation` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 'beep', - 'toppy', - 'lefty', - 'righty', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), Error, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.orientation = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'orientation': 'bottom' - }); - t.strictEqual( node.orientation, 'bottom', 'returns expected value' ); - - node.orientation = 'left'; - t.strictEqual( node.orientation, 'left', 'returns expected value' ); - - node.orientation = 'right'; - t.strictEqual( node.orientation, 'right', 'returns expected value' ); - - node.orientation = 'top'; - t.strictEqual( node.orientation, 'top', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `orientation` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'orientation': 'bottom' - }); - node.on( 'change', onChange ); - node.orientation = 'right'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `orientation` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'orientation': 'bottom' - }); - node.on( 'change', onChange ); - node.orientation = 'bottom'; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value of the `orientation` property determines the tick (tassel) orientation (top)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.orientation = 'top'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_ORIENTATION_TOP, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the `orientation` property determines the tick (tassel) orientation (right)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.orientation = 'right'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_ORIENTATION_RIGHT, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the `orientation` property determines the tick (tassel) orientation (left)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.orientation = 'left'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_ORIENTATION_LEFT, 'expected virtual tree' ); - t.end(); -}); - -tape( 'the value of the `orientation` property determines the tick (tassel) orientation (bottom)', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'top', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE_ORIENTATION_TOP, 'default behavior' ); - - node.orientation = 'bottom'; - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'expected virtual tree' ); - t.end(); -}); diff --git a/components/svg/rug/test/test.render.js b/components/svg/rug/test/test.render.js deleted file mode 100644 index 8e490c2..0000000 --- a/components/svg/rug/test/test.render.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the `render` method returns a rendered virtual tree', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'returns a virtual tree' ); - t.end(); -}); diff --git a/components/svg/rug/test/test.scale.js b/components/svg/rug/test/test.scale.js deleted file mode 100644 index f68345c..0000000 --- a/components/svg/rug/test/test.scale.js +++ /dev/null @@ -1,188 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_SCALE = require( './fixtures/vtree.scale.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `scale` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.scale = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'scale': scale1 - }); - t.deepEqual( node.scale, scale1, 'returns expected value' ); - - node.scale = scale2; - t.deepEqual( node.scale, scale2, 'returns expected value' ); - - t.end(); - - function scale1() { - // no-op... - } - - function scale2() { - // no-op... - } -}); - -tape( 'a scale function is provided one argument: datum', function test( t ) { - var expected; - var actual; - var node; - - node = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'scale': scale, - 'autoRender': false - }); - - expected = [ - 0.10, - 0.50, - 0.90 - ]; - actual = []; - - node.render(); - - t.deepEqual( actual, expected, 'provides expected arguments' ); - t.end(); - - function scale( d ) { - actual.push( d ); - } -}); - -tape( 'setting the `scale` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false, - 'scale': scale1 - }); - node.on( 'change', onChange ); - node.scale = scale2; - - function scale1() { - // no-op... - } - - function scale2() { - // no-op... - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `scale` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'autoRender': false, - 'scale': scale - }); - node.on( 'change', onChange ); - node.scale = scale; - t.pass( 'is ok' ); - t.end(); - - function scale() { - // no-op... - } - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'a scale function maps each data value to a corresponding coordinate value', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.scale = scale; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_SCALE, 'expected virtual tree' ); - t.end(); - - function scale( d ) { - return d * 10.0; - } -}); diff --git a/components/svg/rug/test/test.size.js b/components/svg/rug/test/test.size.js deleted file mode 100644 index 4fe7d91..0000000 --- a/components/svg/rug/test/test.size.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// FIXTURES // - -var VTREE = require( './fixtures/vtree.js' ); -var VTREE_SIZE = require( './fixtures/vtree.size.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `size` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor(); - node.size = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var node; - - node = ctor({ - 'autoRender': false, - 'size': 6 - }); - t.strictEqual( node.size, 6, 'returns expected value' ); - - node.size = 12; - t.strictEqual( node.size, 12, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `size` property triggers a `change` event', function test( t ) { - var node = ctor({ - 'size': 6 - }); - node.on( 'change', onChange ); - node.size = 12; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `size` property to an existing value does not trigger a `change` event', function test( t ) { - var node = ctor({ - 'size': 6 - }); - node.on( 'change', onChange ); - node.size = 6; - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'the value of the `size` property determines the tick (tassel) size', function test( t ) { - var vtree; - var node; - - node = ctor({ - 'autoRender': false, - 'color': '#aaa', - 'data': [ 0.10, 0.50, 0.90 ], - 'label': '', - 'opacity': 0.9, - 'orientation': 'bottom', - 'size': 6 - }); - vtree = node.render(); - - t.deepEqual( vtree, VTREE, 'default behavior' ); - - node.size = 12; - vtree = node.render(); - - t.deepEqual( vtree, VTREE_SIZE, 'expected virtual tree' ); - t.end(); -}); diff --git a/components/svg/rug/test/test.validation.js b/components/svg/rug/test/test.validation.js deleted file mode 100644 index 9a05709..0000000 --- a/components/svg/rug/test/test.validation.js +++ /dev/null @@ -1,371 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the constructor throws an error if provided an `options` argument which is not an object', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor( value ); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `autoRender` option', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'autoRender': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `color` option', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'color': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `data` option', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'data': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `isDefined` option', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'isDefined': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `label` option', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'label': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `opacity` option', function test( t ) { - var values; - var i; - - values = [ - '5', - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'opacity': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws a range error if provided an `opacity` option which is not on the interval `[0,1]`', function test( t ) { - var values; - var i; - - values = [ - -3.14, - 3.14, - NaN - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'opacity': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `orientation` option', function test( t ) { - var values; - var i; - - values = [ - '5', - 'beep', - 'toppy', - 'lefty', - 'righty', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), Error, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'orientation': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `scale` option', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'scale': value - }); - return node; - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid `size` option', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - -3.14, - 3.14, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var node = ctor({ - 'size': value - }); - return node; - }; - } -}); diff --git a/components/svg/symbols/examples/index.js b/components/svg/symbols/examples/index.js deleted file mode 100644 index 0e9b2d9..0000000 --- a/components/svg/symbols/examples/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var symbols = require( './../lib' ); - -// Create a new symbols component: -var sym = symbols({ - 'x': [0.10, 0.50, 0.90], - 'y': [0.43, 0.37, 0.53], - 'symbol': 'open-circle', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = sym.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -sym.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - sym.y = [0.99, 0.87, 0.92]; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/symbols/lib/accessors/is_defined.js b/components/svg/symbols/lib/accessors/is_defined.js deleted file mode 100644 index 347f00b..0000000 --- a/components/svg/symbols/lib/accessors/is_defined.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'symbols:accessor:is-defined' ); - - -// MAIN // - -/** -* Accessor function which determines whether a datum is defined. -* -* @private -* @param {number} d - datum -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/components/svg/symbols/lib/defaults.json b/components/svg/symbols/lib/defaults.json deleted file mode 100644 index 76679ca..0000000 --- a/components/svg/symbols/lib/defaults.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "autoRender": false, - "color": "#000", - "isDefined": null, - "label": "", - "opacity": 0.9, - "size": 6, - "symbol": "closed-circle", - "x": [], - "xScale": null, - "y": [], - "yScale": null -} diff --git a/components/svg/symbols/lib/index.js b/components/svg/symbols/lib/index.js deleted file mode 100644 index c9deaf3..0000000 --- a/components/svg/symbols/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* SVG symbols. -* -* @module @stdlib/plot/components/svg/symbols -* -* @example -* var Symbols = require( '@stdlib/plot/components/svg/symbols' ); -* -* var symbols = new Symbols({ -* 'x': [0.1,0.2,0.3], -* 'y': [0.4,0.5,0.6] -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/symbols/lib/main.js b/components/svg/symbols/lib/main.js deleted file mode 100644 index 0aeb8ca..0000000 --- a/components/svg/symbols/lib/main.js +++ /dev/null @@ -1,521 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: improve JSDoc examples - -// MODULES // - -var EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var format = require( '@stdlib/string/format' ); -var copy = require( '@stdlib/utils/copy' ); -var merge = require( '@stdlib/utils/merge' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var isDefined = require( './accessors/is_defined.js' ); -var defaults = require( './defaults.json' ); -var setSymbol = require( './props/symbol/set.js' ); -var getSymbol = require( './props/symbol/get.js' ); -var setX = require( './props/x/set.js' ); -var getX = require( './props/x/get.js' ); -var setY = require( './props/y/set.js' ); -var getY = require( './props/y/get.js' ); -var setXScale = require( './props/x-scale/set.js' ); -var getXScale = require( './props/x-scale/get.js' ); -var setYScale = require( './props/y-scale/set.js' ); -var getYScale = require( './props/y-scale/get.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setSize = require( './props/size/set.js' ); -var getSize = require( './props/size/get.js' ); -var setOpacity = require( './props/opacity/set.js' ); -var getOpacity = require( './props/opacity/get.js' ); -var setColor = require( './props/color/set.js' ); -var getColor = require( './props/color/get.js' ); -var setLabel = require( './props/label/set.js' ); -var getLabel = require( './props/label/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var getXPos = require( './props/x-pos/get.js' ); -var getYPos = require( './props/y-pos/get.js' ); -var render = require( './render' ); - - -// VARIABLES // - -var debug = logger( 'symbols:main' ); -var PRIVATE_PROPS = [ - '_autoRender', - '_color', - '_isDefined', - '_label', - '_opacity', - '_size', - '_symbol', - '_xData', - '_xScale', - '_yData', - '_yScale' -]; - - -// MAIN // - -/** -* Symbols constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {ArrayLike} [options.x=[]] - x-values -* @param {ArrayLike} [options.y=[]] - y-values -* @param {Function} [options.xScale] - x scale function -* @param {Function} [options.yScale] - y scale function -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.symbol='closed-circle'] - symbol -* @param {(number|Function)} [options.opacity=0.9] - opacity -* @param {(string|Function)} [options.color] - color -* @param {(string|Function)} [options.label] - label -* @param {(NonNegativeInteger|Function)} [options.size=6] - symbol size -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Symbols} Symbols instance -* -* @example -* var symbols = new Symbols({ -* 'x': [0.1,0.2,0.3], -* 'y': [0.4,0.5,0.6] -* }); -*/ -function Symbols( options ) { - var self; - var keys; - var opts; - var key; - var i; - if ( !( this instanceof Symbols ) ) { - if ( arguments.length ) { - return new Symbols( options ); - } - return new Symbols(); - } - self = this; - - opts = copy( defaults ); - opts.isDefined = isDefined; - opts.xScale = linear(); - opts.yScale = linear(); - - if ( arguments.length ) { - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - opts = merge( opts, options ); - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Symbols.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Symbols.prototype.constructor = Symbols; - -/** -* Symbol. -* -* @name symbol -* @memberof Symbols.prototype -* @type {string} -* @throws {TypeError} must be a supported symbol -* @default 'closed-circle' -* -* @example -* var symbols = new Symbols({ -* 'symbol': 'open-circle' -* }); -* -* var symbol = symbols.symbol; -* // returns 'open-circle' -*/ -defineProperty( Symbols.prototype, 'symbol', { - 'configurable': false, - 'enumerable': true, - 'set': setSymbol, - 'get': getSymbol -}); - -/** -* `x` values. -* -* @name x -* @memberof Symbols.prototype -* @type {ArrayLike} -* @throws {TypeError} must be array-like -* @default [] -* -* @example -* var symbols = new Symbols({ -* 'x': [0.1,0.2,0.3] -* }); -* -* var x = symbols.x; -* // returns [0.1,0.2,0.3] -*/ -defineProperty( Symbols.prototype, 'x', { - 'configurable': false, - 'enumerable': true, - 'set': setX, - 'get': getX -}); - -/** -* `y` values. -* -* @name y -* @memberof Symbols.prototype -* @type {ArrayLike} -* @throws {TypeError} must be array-like -* @default [] -* -* @example -* var symbols = new Symbols({ -* 'y': [0.4,0.5,0.6] -* }); -* -* var y = symbols.y; -* // returns [0.4,0.5,0.6] -*/ -defineProperty( Symbols.prototype, 'y', { - 'configurable': false, - 'enumerable': true, - 'set': setY, - 'get': getY -}); - -/** -* `x` scale function. -* -* @name xScale -* @memberof Symbols.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var symbols = new Symbols({ -* 'xScale': function scale(){} -* }); -* -* var f = symbols.xScale; -* // returns -*/ -defineProperty( Symbols.prototype, 'xScale', { - 'configurable': false, - 'enumerable': true, - 'set': setXScale, - 'get': getXScale -}); - -/** -* `y` scale function. -* -* @name yScale -* @memberof Symbols.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var symbols = new Symbols({ -* 'yScale': function scale(){} -* }); -* -* var f = symbols.yScale; -* // returns -*/ -defineProperty( Symbols.prototype, 'yScale', { - 'configurable': false, - 'enumerable': true, - 'set': setYScale, - 'get': getYScale -}); - -/** -* Accessor which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Symbols.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* var symbols = new Symbols(); -* symbols.isDefined = function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* var symbols = new Symbols({ -* 'isDefined': isDefined -* }); -* var fcn = symbols.isDefined; -* // returns -*/ -defineProperty( Symbols.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* Symbol size. When retrieved, the returned value is a size accessor. -* -* @name size -* @memberof Symbols.prototype -* @type {(NonNegativeInteger|Function)} -* @throws {TypeError} must be a nonnegative integer or function -* @default 6 -* -* @example -* var symbols = new Symbols({ -* 'size': 5 -* }); -* -* var size = symbols.size; -* // returns -*/ -defineProperty( Symbols.prototype, 'size', { - 'configurable': false, - 'enumerable': true, - 'set': setSize, - 'get': getSize -}); - -/** -* Symbol opacity. When retrieved, the returned value is an opacity accessor. -* -* @name opacity -* @memberof Symbols.prototype -* @type {(number|Function)} -* @throws {TypeError} must be a number or function -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.9 -* -* @example -* var symbols = new Symbols({ -* 'opacity': 0.5 -* }); -* -* var opacity = symbols.opacity; -* // returns -*/ -defineProperty( Symbols.prototype, 'opacity', { - 'configurable': false, - 'enumerable': true, - 'set': setOpacity, - 'get': getOpacity -}); - -/** -* Symbols color. When retrieved, the returned value is a color accessor. -* -* @name color -* @memberof Symbols.prototype -* @type {(string|Function)} -* @throws {TypeError} must be a string or function -* -* @example -* var symbols = new Symbols({ -* 'color': 'steelblue' -* }); -* -* var color = symbols.color; -* // returns -*/ -defineProperty( Symbols.prototype, 'color', { - 'configurable': false, - 'enumerable': true, - 'set': setColor, - 'get': getColor -}); - -/** -* Symbols label. When retrieved, the returned value is a label accessor. -* -* @name label -* @memberof Symbols.prototype -* @type {(string|Function)} -* @throws {TypeError} must be a string or function -* -* @example -* var symbols = new Symbols({ -* 'label': 'group-1' -* }); -* -* var label = symbols.label; -* // returns -*/ -defineProperty( Symbols.prototype, 'label', { - 'configurable': false, - 'enumerable': true, - 'set': setLabel, - 'get': getLabel -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Symbols.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var symbols = new Symbols({ -* 'autoRender': true -* }); -* -* var mode = symbols.autoRender; -* // returns true -*/ -defineProperty( Symbols.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Function to map values to x coordinate values. -* -* @name xPos -* @memberof Symbols.prototype -* @type {Function} -* -* @example -* var symbols = new Symbols(); -* var xPos = symbols.xPos; -* // returns -*/ -defineProperty( Symbols.prototype, 'xPos', { - 'configurable': false, - 'enumerable': true, - 'get': getXPos -}); - -/** -* Function to map values to y coordinate values. -* -* @name yPos -* @memberof Symbols.prototype -* @type {Function} -* -* @example -* var symbols = new Symbols(); -* var yPos = symbols.yPos; -* // returns -*/ -defineProperty( Symbols.prototype, 'yPos', { - 'configurable': false, - 'enumerable': true, - 'get': getYPos -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Symbols.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var symbols = new Symbols(); -* -* var out = symbols.render(); -*/ -setReadOnly( Symbols.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Symbols; diff --git a/components/svg/symbols/lib/props/auto-render/get.js b/components/svg/symbols/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/symbols/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/auto-render/set.js b/components/svg/symbols/lib/props/auto-render/set.js deleted file mode 100644 index 8509b85..0000000 --- a/components/svg/symbols/lib/props/auto-render/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/color/get.js b/components/svg/symbols/lib/props/color/get.js deleted file mode 100644 index e087bef..0000000 --- a/components/svg/symbols/lib/props/color/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a symbol's color. -* -* @private -* @returns {Function} color accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isString( this._color ) ) { - return color; - } - return this._color; - - /** - * Returns the color. - * - * @private - * @returns {string} color - */ - function color() { - return self._color; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/color/set.js b/components/svg/symbols/lib/props/color/set.js deleted file mode 100644 index e72fcb1..0000000 --- a/components/svg/symbols/lib/props/color/set.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:color' ); - - -// MAIN // - -/** -* Sets the color. -* -* @private -* @param {(string|Function)} color - color -* @throws {TypeError} must be a string or function -*/ -function set( color ) { - /* eslint-disable no-invalid-this */ - if ( - !isString( color ) && - !isFunction( color ) - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'color', color ) ); - } - debug( 'Current value: %d.', this._color ); - - this._color = color; - debug( 'New Value: %d.', this._color ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/is-defined/get.js b/components/svg/symbols/lib/props/is-defined/get.js deleted file mode 100644 index fd05f22..0000000 --- a/components/svg/symbols/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the accessor for defined values. -* -* @private -* @returns {Function} accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/is-defined/set.js b/components/svg/symbols/lib/props/is-defined/set.js deleted file mode 100644 index 8c44937..0000000 --- a/components/svg/symbols/lib/props/is-defined/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:is-defined' ); - - -// MAIN // - -/** -* Sets the accessor for defined values. -* -* @private -* @param {Function} fcn - accessor -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/label/get.js b/components/svg/symbols/lib/props/label/get.js deleted file mode 100644 index 8aa635d..0000000 --- a/components/svg/symbols/lib/props/label/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a symbol's label. -* -* @private -* @returns {Function} label accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isString( this._label ) ) { - return label; - } - return this._label; - - /** - * Returns the label. - * - * @private - * @returns {string} label - */ - function label() { - return self._label; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/label/set.js b/components/svg/symbols/lib/props/label/set.js deleted file mode 100644 index 698c3f2..0000000 --- a/components/svg/symbols/lib/props/label/set.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:label' ); - - -// MAIN // - -/** -* Sets the label. -* -* @private -* @param {(string|Function)} label - label -* @throws {TypeError} must be a string or a function -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( - !isString( label ) && - !isFunction( label ) - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'label', label ) ); - } - debug( 'Current value: %d.', this._label ); - - this._label = label; - debug( 'New Value: %d.', this._label ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/opacity/get.js b/components/svg/symbols/lib/props/opacity/get.js deleted file mode 100644 index bc8833f..0000000 --- a/components/svg/symbols/lib/props/opacity/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a symbol's opacity. -* -* @private -* @returns {Function} opacity accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isNumber( this._opacity ) ) { - return opacity; - } - return this._opacity; - - /** - * Returns the opacity. - * - * @private - * @returns {number} opacity - */ - function opacity() { - return self._opacity; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/opacity/set.js b/components/svg/symbols/lib/props/opacity/set.js deleted file mode 100644 index e718d22..0000000 --- a/components/svg/symbols/lib/props/opacity/set.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:opacity' ); - - -// MAIN // - -/** -* Sets the symbol opacity. -* -* @private -* @param {(number|Function)} opacity - opacity -* @throws {TypeError} must be a number or a function -* @throws {RangeError} must be a number on the interval `[0,1]` -*/ -function set( opacity ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( opacity ); - if ( - !isNum && - !isFunction( opacity ) - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or a function. Value: `%s`.', 'opacity', opacity ) ); - } - if ( - isNum && - (opacity < 0.0 || opacity > 1.0) - ) { - throw new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) ); - } - debug( 'Current value: %d.', this._opacity ); - - this._opacity = opacity; - debug( 'New Value: %d.', this._opacity ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/size/get.js b/components/svg/symbols/lib/props/size/get.js deleted file mode 100644 index 2958a6b..0000000 --- a/components/svg/symbols/lib/props/size/get.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; - - -// MAIN // - -/** -* Returns a function to get a symbol's size. -* -* @private -* @returns {Function} size accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - var self = this; - if ( isNumber( this._size ) ) { - return size; - } - return this._size; - - /** - * Returns the size. - * - * @private - * @returns {number} size - */ - function size() { - return self._size; // eslint-disable-line no-underscore-dangle - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/size/set.js b/components/svg/symbols/lib/props/size/set.js deleted file mode 100644 index 1c4eef9..0000000 --- a/components/svg/symbols/lib/props/size/set.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:size' ); - - -// MAIN // - -/** -* Sets the symbol size. -* -* @private -* @param {(NonNegativeInteger|Function)} size - size -* @throws {TypeError} must be a nonnegative integer or a function -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - if ( - !isNonNegativeInteger( size ) && - !isFunction( size ) - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or a function. Value: `%s`.', 'size', size ) ); - } - debug( 'Current value: %d.', this._size ); - - this._size = size; - debug( 'New Value: %d.', this._size ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/symbol/get.js b/components/svg/symbols/lib/props/symbol/get.js deleted file mode 100644 index 54e9365..0000000 --- a/components/svg/symbols/lib/props/symbol/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the symbol. -* -* @private -* @returns {string} symbol -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._symbol; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/symbol/set.js b/components/svg/symbols/lib/props/symbol/set.js deleted file mode 100644 index 6fd10f8..0000000 --- a/components/svg/symbols/lib/props/symbol/set.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var SYMBOLS = require( './symbols.json' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:symbol' ); - - -// MAIN // - -/** -* Sets the symbol. -* -* @private -* @param {string} symbol - symbol -* @throws {TypeError} must be a supported symbol -*/ -function set( symbol ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( SYMBOLS, symbol ) === -1 ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a supported symbol. Symbols: "%s". Value: `%s`.', 'symbol', SYMBOLS.join( '", "' ), symbol ) ); - } - debug( 'Current value: %d.', this._symbol ); - - this._symbol = symbol; - debug( 'New Value: %d.', this._symbol ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/symbol/symbols.json b/components/svg/symbols/lib/props/symbol/symbols.json deleted file mode 100644 index 0f0345a..0000000 --- a/components/svg/symbols/lib/props/symbol/symbols.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "closed-circle", - "open-circle" -] diff --git a/components/svg/symbols/lib/props/x-pos/get.js b/components/svg/symbols/lib/props/x-pos/get.js deleted file mode 100644 index 75c92dc..0000000 --- a/components/svg/symbols/lib/props/x-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'symbols:xpos' ); - - -// MAIN // - -/** -* Returns a function to map values to x coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.xScale; - - return xPos; - /** - * Maps a value to a x coordinate value. - * - * @private - * @param {*} d - datum - * @returns {number} pixel value - */ - function xPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/x-scale/get.js b/components/svg/symbols/lib/props/x-scale/get.js deleted file mode 100644 index a3ad33f..0000000 --- a/components/svg/symbols/lib/props/x-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/x-scale/set.js b/components/svg/symbols/lib/props/x-scale/set.js deleted file mode 100644 index bb7d9f4..0000000 --- a/components/svg/symbols/lib/props/x-scale/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:xscale' ); - - -// MAIN // - -/** -* Sets the x-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xScale', fcn ) ); - } - debug( 'Current value: %s.', this._xScale ); - - this._xScale = fcn; - debug( 'New Value: %s.', this._xScale ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/x/get.js b/components/svg/symbols/lib/props/x/get.js deleted file mode 100644 index fcddeb2..0000000 --- a/components/svg/symbols/lib/props/x/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the `x` values. -* -* @private -* @returns {ArrayLike} x values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xData; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/x/set.js b/components/svg/symbols/lib/props/x/set.js deleted file mode 100644 index fc654b8..0000000 --- a/components/svg/symbols/lib/props/x/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:x' ); - - -// MAIN // - -/** -* Sets the `x` values. -* -* @private -* @param {ArrayLike} x - x values -* @throws {TypeError} must be array-like -*/ -function set( x ) { - /* eslint-disable no-invalid-this */ - if ( !isArrayLike( x ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'x', x ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._xData ) ); - - this._xData = x; - debug( 'New Value: %s.', JSON.stringify( this._xData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/y-pos/get.js b/components/svg/symbols/lib/props/y-pos/get.js deleted file mode 100644 index d8bed7c..0000000 --- a/components/svg/symbols/lib/props/y-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'symbols:ypos' ); - - -// MAIN // - -/** -* Returns a function to map values to y coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.yScale; - return yPos; - - /** - * Maps a value to a y coordinate value. - * - * @private - * @param {*} d - datum - * @returns {number} pixel value - */ - function yPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/y-scale/get.js b/components/svg/symbols/lib/props/y-scale/get.js deleted file mode 100644 index 83f782c..0000000 --- a/components/svg/symbols/lib/props/y-scale/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-scale function. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yScale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/y-scale/set.js b/components/svg/symbols/lib/props/y-scale/set.js deleted file mode 100644 index 055b20f..0000000 --- a/components/svg/symbols/lib/props/y-scale/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:yscale' ); - - -// MAIN // - -/** -* Sets the y-scale function. -* -* @private -* @param {Function} fcn - scale -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yScale', fcn ) ); - } - debug( 'Current value: %s.', this._yScale ); - - this._yScale = fcn; - debug( 'New Value: %s.', this._yScale ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/props/y/get.js b/components/svg/symbols/lib/props/y/get.js deleted file mode 100644 index 459d022..0000000 --- a/components/svg/symbols/lib/props/y/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the `y` values. -* -* @private -* @returns {ArrayLike} y values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yData; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/symbols/lib/props/y/set.js b/components/svg/symbols/lib/props/y/set.js deleted file mode 100644 index 83be3a3..0000000 --- a/components/svg/symbols/lib/props/y/set.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'symbols:set:y' ); - - -// MAIN // - -/** -* Sets the `y` values. -* -* @private -* @param {ArrayLike} y - y values -* @throws {TypeError} must be array-like -*/ -function set( y ) { - /* eslint-disable no-invalid-this */ - if ( !isArrayLike( y ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'y', y ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._yData ) ); - - this._yData = y; - debug( 'New Value: %s.', JSON.stringify( this._yData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/symbols/lib/render/closed_circles.js b/components/svg/symbols/lib/render/closed_circles.js deleted file mode 100644 index fcc6a30..0000000 --- a/components/svg/symbols/lib/render/closed_circles.js +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'symbols:render:closed-circles' ); -var ELEMENT = 'circle'; - - -// MAIN // - -/** -* Renders data as a closed circles. -* -* @private -* @param {Object} state - state -* @returns {Array} array of virtual trees -*/ -function render( state ) { - var isDefined; - var opacity; - var label; - var color; - var props; - var size; - var xPos; - var yPos; - var out; - var xi; - var yi; - var x; - var y; - var i; - - debug( 'Rendering closed circles...' ); - - isDefined = state.isDefined; - opacity = state.opacity; - label = state.label; - color = state.color; - size = state.size; - xPos = state.xPos; - yPos = state.yPos; - x = state.x; - y = state.y; - - out = []; - for ( i = 0; i < x.length; i++ ) { - xi = x[ i ]; - yi = y[ i ]; - if ( !isDefined( xi ) || !isDefined( yi ) ) { - debug( 'Datum %d is undefined. [%s,%s].', i, xi, yi ); - continue; - } - debug( 'Rendering datum %d...', i ); - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'closed-circle', - 'className': 'closed-circle', - 'attributes': { - 'cx': xPos( xi ), - 'cy': yPos( yi ), - 'r': size( xi, yi, i ) / 2, - 'stroke': 'none', - 'opacity': opacity( xi, yi, i ), - 'fill': color( xi, yi, i ), - 'data-label': label( xi, yi, i ) - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - out.push( h( ELEMENT, props, [] ) ); - } - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/symbols/lib/render/index.js b/components/svg/symbols/lib/render/index.js deleted file mode 100644 index 63c13dc..0000000 --- a/components/svg/symbols/lib/render/index.js +++ /dev/null @@ -1,78 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); -var closedCircles = require( './closed_circles.js' ); -var openCircles = require( './open_circles.js' ); - - -// VARIABLES // - -var debug = logger( 'symbols:render' ); -var ELEMENT = 'g'; -var RENDER = { - 'closed-circle': closedCircles, - 'open-circle': openCircles -}; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var children; - var props; - var vtree; - var f; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'symbols', - 'className': 'symbols' - }; - debug( 'Symbol: %s.', this.symbol ); - - f = RENDER[ this.symbol ]; - children = f( this ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, children ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/symbols/lib/render/open_circles.js b/components/svg/symbols/lib/render/open_circles.js deleted file mode 100644 index 57f5d55..0000000 --- a/components/svg/symbols/lib/render/open_circles.js +++ /dev/null @@ -1,103 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'symbols:render:open-circles' ); -var ELEMENT = 'circle'; - - -// MAIN // - -/** -* Renders data as a open circles. -* -* @private -* @param {Object} state - state -* @returns {Array} array of virtual trees -*/ -function render( state ) { - var isDefined; - var opacity; - var label; - var color; - var props; - var size; - var xPos; - var yPos; - var out; - var xi; - var yi; - var x; - var y; - var i; - - debug( 'Rendering open circles...' ); - - isDefined = state.isDefined; - opacity = state.opacity; - label = state.label; - color = state.color; - size = state.size; - xPos = state.xPos; - yPos = state.yPos; - x = state.x; - y = state.y; - - out = new Array( x.length ); - for ( i = 0; i < x.length; i++ ) { - xi = x[ i ]; - yi = y[ i ]; - if ( !isDefined( xi ) || !isDefined( yi ) ) { - debug( 'Datum %d is undefined. [%s,%s].', i, xi, yi ); - continue; - } - debug( 'Rendering datum %d...', i ); - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'open-circle', - 'className': 'open-circle', - 'attributes': { - 'cx': xPos( xi ), - 'cy': yPos( yi ), - 'r': size( xi, yi, i ) / 2, - 'fill': 'none', - 'opacity': opacity( xi, yi, i ), - 'stroke': color( xi, yi, i ), - 'stroke-width': 1, // TODO: make property? I certainly don't see a good reason or use case why this should be a function. - 'data-label': label( xi, yi, i ) - } - }; - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - out[ i ] = h( ELEMENT, props, [] ); - } - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/symbols/package.json b/components/svg/symbols/package.json deleted file mode 100644 index 587e055..0000000 --- a/components/svg/symbols/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/symbols", - "version": "0.0.0", - "description": "SVG symbols.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "symbols", - "circles", - "scatter", - "series", - "component" - ] -} diff --git a/components/svg/title/examples/index.js b/components/svg/title/examples/index.js deleted file mode 100644 index 7f6c4b8..0000000 --- a/components/svg/title/examples/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 toHTML = require( 'vdom-to-html' ); -var title = require( './../lib' ); - -// Create a new title: -var node = title({ - 'text': 'Beep', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = node.render(); -console.log( JSON.stringify( vtree ) ); - -// Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -node.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - node.text = 'Boop'; -} - -function onRender( vtree ) { - console.log( toHTML( vtree ) ); -} diff --git a/components/svg/title/lib/defaults.json b/components/svg/title/lib/defaults.json deleted file mode 100644 index c835193..0000000 --- a/components/svg/title/lib/defaults.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "text": "", - "autoRender": false -} diff --git a/components/svg/title/lib/events/events.json b/components/svg/title/lib/events/events.json deleted file mode 100644 index 31e673d..0000000 --- a/components/svg/title/lib/events/events.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "text": "change", - "autoRender": "change" -} diff --git a/components/svg/title/lib/events/index.js b/components/svg/title/lib/events/index.js deleted file mode 100644 index ef68b2b..0000000 --- a/components/svg/title/lib/events/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EVENTS = require( './events.json' ); - - -// MAIN // - -/** -* Provided a property, returns a corresponding event name for when a property value changes. -* -* @private -* @param {string} prop - property -* @returns {string} event name -*/ -function get( prop ) { - return EVENTS[ prop ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/title/lib/index.js b/components/svg/title/lib/index.js deleted file mode 100644 index 7c83f0a..0000000 --- a/components/svg/title/lib/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Title. -* -* @module @stdlib/plot/components/svg/title -* -* @example -* var Title = require( '@stdlib/plot/components/svg/title' ); -* -* var title = new Title({ -* 'text': 'Beep' -* }); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/components/svg/title/lib/main.js b/components/svg/title/lib/main.js deleted file mode 100644 index e45678b..0000000 --- a/components/svg/title/lib/main.js +++ /dev/null @@ -1,198 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var copy = require( '@stdlib/utils/copy' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); -var setText = require( './props/text/set.js' ); -var getText = require( './props/text/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var render = require( './methods/render.js' ); - - -// VARIABLES // - -var debug = logger( 'title:main' ); - - -// MAIN // - -/** -* Title constructor. -* -* @constructor -* @param {Options} options - constructor options -* @param {string} [options.text] - title text -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @throws {TypeError} must provide valid options -* @returns {Title} title instance -* -* @example -* var title = new Title({ -* 'text':'Beep' -* }); -*/ -function Title( options ) { - var self; - var opts; - var err; - if ( !( this instanceof Title ) ) { - return new Title( options ); - } - self = this; - opts = copy( defaults ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - defineProperty( this, '_text', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.text - }); - defineProperty( this, '_autoRender', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': opts.autoRender - }); - - this.on( 'change', onChange ); - this.on( '_render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - debug( 'Received a change event.' ); - if ( self._autoRender ) { // eslint-disable-line no-underscore-dangle - self.render(); - } - } - - /** - * Re-emits a render event. - * - * @private - */ - function onRender() { - var args; - var i; - debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; - for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; - } - self.emit.apply( self, args ); - } -} - -/* -* Create a prototype which inherits from the parent prototype. -*/ -Title.prototype = Object.create( EventEmitter.prototype ); - -/* -* Set the constructor. -*/ -Title.prototype.constructor = Title; - -/** -* Title text. -* -* @name text -* @memberof Title.prototype -* @type {string} -* @throws {TypeError} must be a string -* -* @example -* var title = new Title({ -* 'text': 'Beep' -* }); -* -* var text = title.text; -* // returns 'Beep' -*/ -defineProperty( Title.prototype, 'text', { - 'configurable': false, - 'enumerable': true, - 'set': setText, - 'get': getText -}); - -/** -* Rendering mode. If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Title.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var title = new Title({ -* 'autoRender': true -* }); -* -* var mode = title.autoRender; -* // returns true -*/ -defineProperty( Title.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Renders a virtual DOM tree. -* -* @name render -* @memberof Title.prototype -* @type {Function} -* @returns {VTree} virtual tree -* -* @example -* var title = new Title(); -* -* var out = title.render(); -*/ -setReadOnly( Title.prototype, 'render', render ); - - -// EXPORTS // - -module.exports = Title; diff --git a/components/svg/title/lib/methods/render.js b/components/svg/title/lib/methods/render.js deleted file mode 100644 index bd7418c..0000000 --- a/components/svg/title/lib/methods/render.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var h = require( 'virtual-dom/h.js' ); - - -// VARIABLES // - -var debug = logger( 'title:render' ); -var ELEMENT = 'text'; - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @returns {VTree} virtual DOM tree -*/ -function render() { - /* eslint-disable no-invalid-this */ - var props; - var vtree; - var text; - - debug( 'Rendering...' ); - - props = { - 'namespace': 'http://www.w3.org/2000/svg', - 'property': 'title', - 'className': 'title noselect', - 'attributes': { - 'x': 0, - 'y': 0, - 'text-anchor': 'middle' - } - }; - - text = this.text; - debug( 'Title: %s.', text ); - - debug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) ); - vtree = h( ELEMENT, props, text ); - - // Announce that a new tree has been rendered: - this.emit( '_render', vtree ); - - return vtree; -} - - -// EXPORTS // - -module.exports = render; diff --git a/components/svg/title/lib/props/auto-render/get.js b/components/svg/title/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/components/svg/title/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/title/lib/props/auto-render/set.js b/components/svg/title/lib/props/auto-render/set.js deleted file mode 100644 index 13d40d7..0000000 --- a/components/svg/title/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/auto_render.js' ); - - -// VARIABLES // - -var debug = logger( 'title:set:auto-render' ); -var CHANGE_EVENT = events( 'autoRender' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a positive number -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - var err = isValid( bool ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/title/lib/props/text/get.js b/components/svg/title/lib/props/text/get.js deleted file mode 100644 index b206c3c..0000000 --- a/components/svg/title/lib/props/text/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the title text. -* -* @private -* @returns {string} text -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._text; -} - - -// EXPORTS // - -module.exports = get; diff --git a/components/svg/title/lib/props/text/set.js b/components/svg/title/lib/props/text/set.js deleted file mode 100644 index cdc1e40..0000000 --- a/components/svg/title/lib/props/text/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var events = require( './../../events' ); -var isValid = require( './../../validators/text.js' ); - - -// VARIABLES // - -var debug = logger( 'title:set:text' ); -var CHANGE_EVENT = events( 'text' ); - - -// MAIN // - -/** -* Sets the title text. -* -* @private -* @param {string} text - text -* @throws {TypeError} must be a string -*/ -function set( text ) { - /* eslint-disable no-invalid-this */ - var err = isValid( text ); - if ( err ) { - throw err; - } - debug( 'Current value: %d.', this._text ); - - this._text = text; - debug( 'New Value: %d.', this._text ); - - this.emit( CHANGE_EVENT ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/components/svg/title/lib/validate.js b/components/svg/title/lib/validate.js deleted file mode 100644 index fbf33ae..0000000 --- a/components/svg/title/lib/validate.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var validators = require( './validators' ); - - -// VARIABLES // - -var KEYS = objectKeys( validators ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Object} opts - destination object -* @param {Options} options - function options -* @param {string} [options.text] - title text -* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event -* @returns {(Error|null)} error or null -* -* @example -* var opts = {}; -* var options = { -* 'text': 'Beep' -* }; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var err; - var key; - var val; - var i; - if ( !isObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < KEYS.length; i++ ) { - key = KEYS[ i ]; - if ( hasOwnProp( options, key ) ) { - val = options[ key ]; - err = validators[ key ]( val ); - if ( err ) { - return err; - } - opts[ key ] = val; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/components/svg/title/lib/validators/auto_render.js b/components/svg/title/lib/validators/auto_render.js deleted file mode 100644 index 08da79f..0000000 --- a/components/svg/title/lib/validators/auto_render.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `autoRender`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isBoolean( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/title/lib/validators/index.js b/components/svg/title/lib/validators/index.js deleted file mode 100644 index 40a493e..0000000 --- a/components/svg/title/lib/validators/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 text = require( './text.js' ); -var autoRender = require( './auto_render.js' ); - - -// MAIN // - -var validators = { - 'text': text, - 'autoRender': autoRender -}; - - -// EXPORTS // - -module.exports = validators; diff --git a/components/svg/title/lib/validators/text.js b/components/svg/title/lib/validators/text.js deleted file mode 100644 index 1a15f41..0000000 --- a/components/svg/title/lib/validators/text.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates `text`. -* -* @private -* @param {*} v - value to test -* @returns {(Error|null)} error object or null -*/ -function test( v ) { - if ( !isString( v ) ) { - return new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'text', v ) ); - } - return null; -} - - -// EXPORTS // - -module.exports = test; diff --git a/components/svg/title/package.json b/components/svg/title/package.json deleted file mode 100644 index 942b882..0000000 --- a/components/svg/title/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@stdlib/plot/components/svg/title", - "version": "0.0.0", - "description": "SVG title.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "graph", - "chart", - "engine", - "svg", - "scalable", - "vector", - "graphics", - "title", - "component" - ] -} diff --git a/ctor/README.md b/ctor/README.md deleted file mode 100644 index 91f1cf6..0000000 --- a/ctor/README.md +++ /dev/null @@ -1,1498 +0,0 @@ - - -# Plot - -> Create a 2-dimensional plot. - -
- - - - - -
- - - -
- -## Usage - -```javascript -var Plot = require( '@stdlib/plot/ctor' ); -``` - -#### Plot( \[x, y,] \[options] ) - -Returns a `plot` instance for creating 2-dimensional plots. - -```javascript -var plot = new Plot(); -// returns -``` - -To provide plot data at instantiation, provide `x` **and** `y` data as arguments. - -```javascript -var x = [[0.10, 0.20, 0.30]]; -var y = [[0.52, 0.79, 0.64]]; - -var plot = new Plot( x, y ); -// returns -``` - -The function accepts the following `options`: - -- [**autoRender**](#prop-auto-render): `boolean` indicating whether to re-render on a `change` event. Default: `false`. -- [**autoView**](#prop-auto-view): `boolean` indicating whether to generate an updated view on a `render` event. Default: `false`. -- [**colors**](#prop-colors): data color(s). Default: `category10`. -- [**description**](#prop-description): plot description. Default: `''`. -- [**engine**](#prop-engine): plot engine. Default: `svg`. -- [**height**](#prop-height): plot height. Default: `400` (pixels). -- [**labels**](#prop-labels): data labels. -- [**isDefined**](#prop-is-defined): accessor `function` indicating whether a datum is defined. -- [**lineStyle**](#prop-line-style): data line style(s). Default: `'-'`. -- [**lineOpacity**](#prop-line-opacity): data line opacity. Default: `0.9`. -- [**lineWidth**](#prop-line-width): data line width. Default: `2` (pixels). -- [**paddingBottom**](#prop-padding-bottom): bottom padding. Default: `80` (pixels). -- [**paddingLeft**](#prop-padding-left): left padding. Default: `90` (pixels). -- [**paddingRight**](#prop-padding-right): right padding. Default: `20` (pixels). -- [**paddingTop**](#prop-padding-top): top padding. Default: `80` (pixels). -- [**renderFormat**](#prop-render-format): render format. Default: `'vdom'`. -- [**symbols**](#prop-symbols): data symbols. Default: `'none'`. -- [**symbolsOpacity**](#prop-symbols-opacity): symbols opacity. Default: `0.9`. -- [**symbolsSize**](#prop-symbols-size): symbols size. Default: `6` (pixels). -- [**title**](#prop-title): plot title. Default: `''`. -- [**viewer**](#prop-viewer): plot viewer. Default: `'none'`. -- [**width**](#prop-width): plot width. Default: `400` (pixels). -- [**x**](#prop-x): `x` values. Default: `[]`. -- [**xAxisOrient**](#prop-x-axis-orient): `x`-axis orientation. Default: `'bottom'`. -- [**xLabel**](#prop-x-label): `x`-axis label. Default: `'x'`. -- [**xMax**](#prop-x-max): maximum value of the `x`-axis domain. Default: `null`. -- [**xMin**](#prop-x-min): minimum value of the `x`-axis domain. Default: `null`. -- [**xNumTicks**](#prop-x-num-ticks): number of `x`-axis tick marks. Default: `5`. -- [**xRug**](#prop-x-rug): `boolean` indicating whether to render a rug plot along an `x`-axis. -- [**xRugOrient**](#prop-x-rug-orient): `x`-axis rug orientation. Default: `'bottom'`. -- [**xRugOpacity**](#prop-x-rug-opacity): `x`-axis rug opacity. Default: `0.1`. -- [**xRugSize**](#prop-x-rug-size): `x`-axis rug tick (tassel) size. Default: `6` (pixels). -- [**xScale**](#prop-x-scale): `x`-axis scale. Default: `'linear'`. -- [**xTickFormat**](#prop-x-tick-format): `x`-axis tick format. Default: `null`. -- [**y**](#prop-y): `y` values. Default: `[]`. -- [**yAxisOrient**](#prop-y-axis-orient): `y`-axis orientation. Default: `'left'`. -- [**yLabel**](#prop-y-label): `y`-axis label. Default: `'y'`. -- [**yMax**](#prop-y-max): maximum value of the `y`-axis domain. Default: `null`. -- [**yMin**](#prop-y-min): minimum value of the `y`-axis domain. Default: `null`. -- [**yNumTicks**](#prop-y-num-ticks): number of `y`-axis tick marks. Default: `5`. -- [**yRug**](#prop-y-rug): `boolean` indicating whether to render a rug plot along an `y`-axis. -- [**yRugOrient**](#prop-y-rug-orient): `y`-axis rug orientation. Default: `'left'`. -- [**yRugOpacity**](#prop-y-rug-opacity): `y`-axis rug opacity. Default: `0.1`. -- [**yRugSize**](#prop-y-rug-size): `y`-axis rug tick (tassel) size. Default: `6` (pixels). -- [**yScale**](#prop-y-scale): `y`-axis scale. Default: `'linear'`. -- [**yTickFormat**](#prop-y-tick-format): `y`-axis tick format. Default: `null`. - -In addition to supporting `x` and `y` data as arguments, the constructor supports providing data via the `x` and `y` options. - -```javascript -var opts = { - 'x': [[0.10, 0.20, 0.30]], - 'y': [[0.52, 0.79, 0.64]] -}; - -var plot = new Plot( opts ); -// returns -``` - -Note that `x` and `y` arguments take precedence over `x` and `y` options. - -```javascript -var opts = { - 'x': [[0.10, 0.20, 0.30]], - 'y': [[0.52, 0.79, 0.64]] -}; - -var x = [[0.40, 0.50, 0.60]]; -var y = [[0.37, 0.51, 0.44]]; - -var plot = new Plot( x, y, opts ); - -var x1 = plot.x; -// returns [[0.40, 0.50, 0.60]] - -var y1 = plot.y; -// returns [[0.37, 0.51, 0.44]] -``` - -* * * - -### Methods - - - -#### Plot.prototype.render( \[format] ) - -Renders a plot. - -```javascript -var plot = new Plot(); -var vtree = plot.render(); -// returns -``` - -By default, the method renders a plot as a [virtual DOM tree][vdom]. To render to an alternative format, provide a `format` argument. - -```javascript -var plot = new Plot(); -var vtree = plot.render( 'html' ); -// returns -``` - - - -#### Plot.prototype.view( \[viewer] ) - -Generates a plot view. - -```javascript -var plot = new Plot(); -plot.view(); -``` - -To generate a particular plot view without updating the [`viewer`](#prop-viewer) property, provide a `viewer`. - -```javascript -var plot = new Plot(); -plot.view( 'stdout' ); -``` - -* * * - -### Writable Properties - - - -#### Plot.prototype.x - -`x` values. The `x` property value must be an `array`, where each element corresponds to a plotted dataset. - -```javascript -var plot = new Plot(); - -// Set: -plot.x = [ - [ 1417563950959, 1417563952959 ], // dataset 1 - [ 1417563950959, 1417563952959 ] // dataset 2 -]; - -// Get: -var x = plot.x; -// returns [ [ 1417563950959, 1417563952959 ], [ 1417563950959, 1417563952959 ] ] -``` - - - -#### Plot.prototype.y - -`y` values. The `y` property value must be an `array`, where each element corresponds to a plotted dataset. - -```javascript -var plot = new Plot(); - -// Set: -plot.y = [ - [ 0.25, 0.23 ], // dataset 1 - [ 0.72, 0.89 ] // dataset 2 -]; - -// Get: -var y = plot.y; -// returns [ [ 0.25, 0.23 ], [ 0.72, 0.89 ] ] -``` - - - -#### Plot.prototype.labels - -Data labels. During plot creation, each plotted dataset is assigned a `label`. If the number of `labels` is less than the number of plotted datasets, `labels` are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -// Set: -plot.labels = [ - 'beep', // assigned to datasets 0,2,4,... - 'boop' // assigned to datasets 1,3,5,... -]; - -// Get: -var labels = plot.labels; -// returns ['beep','boop'] -``` - - - -#### Plot.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum -- **i**: datum index - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var plot = new Plot(); - -// Set: -plot.isDefined = isDefined; - -// Get: -var fcn = plot.isDefined; -// returns -``` - -The default behavior is to ignore values which are `NaN`. - - - -#### Plot.prototype.colors - -Data colors. To set the `color` for all plotted datasets, provide a `color` name. - -```javascript -var plot = new Plot(); - -// Set: -plot.colors = '#474747'; - -// Get: -var colors = plot.colors; -// returns ['#474747'] -``` - -To specify the colors for each dataset, provide an `array` of colors. During plot creation, each plotted dataset is assigned one of the provided colors. If the number of colors is less than the number of plotted datasets, colors are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.colors = [ - '#000', // assigned to datasets 0,3,6,9,... - 'rgb(100,100,100)', // assigned to datasets 1,4,7,10,... - 'red' // assigned to datasets 2,5,8,11,... -]; - -// Get: -var colors = plot.colors; -// returns ['#000','rgb(100,100,100)','red'] -``` - -A `plot` instance also supports providing the name of a predefined color scheme. The following schemes are supported: - -- **category10** -- **category20** -- **category20b** -- **category20c** - - - -```javascript -var plot = new Plot(); - -// Set: -plot.colors = 'category20'; - -// Get: -var colors = plot.colors; -// returns -``` - - - -#### Plot.prototype.lineStyle - -Data line style(s). The following line styles are supported: - -- `'-'`: solid line. -- `'--'`: dashed line. -- `':'`: dotted line. -- `'-.'`: alternating dashes and dots. -- `'none'`: no line. - -To set the line style for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.lineStyle = '-'; // all solid lines - -// Get: -var lineStyle = plot.lineStyle; -// returns ['-'] -``` - -To specify the line style for each dataset, provide an `array` of line styles. During plot creation, each plotted dataset is assigned a `lineStyle`. If the number of line styles is less than the number of plotted datasets, line styles are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.lineStyle = [ - ':', // assigned to datasets 0,3,6,9,... - 'none', // assigned to datasets 1,4,7,10,... - '--' // assigned to datasets 2,5,8,11,... -]; -``` - - - -#### Plot.prototype.lineOpacity - -Data line opacity, where an opacity of `0.0` makes a line completely transparent and an opacity of `1.0` makes a line completely opaque. To set the opacity for all plotted lines, - -```javascript -var plot = new Plot(); - -// Set: -plot.lineOpacity = 0.9; - -// Get: -var opacity = plot.lineOpacity; -// returns [0.9] -``` - -To specify the line opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.lineOpacity = [ - 0.7, // assigned to datasets 0,3,6,9,... - 0.2, // assigned to datasets 1,4,7,10,... - 1.0 // assigned to datasets 2,5,8,11,... -]; -``` - - - -#### Plot.prototype.lineWidth - -Data line width(s). To set the line widths for all plotted lines, - -```javascript -var plot = new Plot(); - -// Set: -plot.lineWidth = 1; - -// Get: -var width = plot.lineWidth; -// returns [1] -``` - -To specify the line width for each dataset, provide an `array` of widths. During plot creation, each plotted dataset is assigned a line width. If the number of line widths is less than the number of plotted datasets, line widths are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.lineWidth = [ - 1, // assigned to datasets 0,2,4,... - 3 // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.symbols - -Data symbols. The following symbols are supported: - -- `'closed-circle'`: closed circles. -- `'open-circle'`: open circles. -- `'none'`: no symbols. - -To set the symbols for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.symbols = 'closed-circle'; - -// Get: -var sym = plot.symbols; -// returns ['closed-circle'] -``` - -To specify the symbols used for each dataset, provide an `array` of symbols. During plot creation, each plotted dataset is assigned a symbol. If the number of symbols is less than the number of plotted datasets, symbols are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.symbols = [ - 'closed-circle', // assigned to datasets 0,3,6,9,... - 'none', // assigned to datasets 1,4,7,10,... - 'open-circle' // assigned to datasets 2,5,8,11,... -]; -``` - - - -#### Plot.prototype.symbolsSize - -Symbols size. To set the size of all symbols, - -```javascript -var plot = new Plot(); - -// Set: -plot.symbolsSize = 4; - -// Get: -var size = plot.symbolsSize; -// returns [4] -``` - -To specify the symbols size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a symbols size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.symbolsSize = [ - 4, // assigned to datasets 0,2,4,... - 6 // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.symbolsOpacity - -Symbols opacity, where an opacity of `0.0` makes a symbol completely transparent and an opacity of `1.0` makes a symbol completely opaque. To set the opacity for all plotted symbols, - -```javascript -var plot = new Plot(); - -// Set: -plot.symbolsOpacity = 0.9; - -// Get: -var opacity = plot.symbolsOpacity; -// returns [0.9] -``` - -To specify the opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.symbolsOpacity = [ - 0.7, // assigned to datasets 0,3,6,9,... - 0.2, // assigned to datasets 1,4,7,10,... - 1.0 // assigned to datasets 2,5,8,11,... -]; -``` - - - -#### Plot.prototype.width - -Plot width (in pixels). - -```javascript -var plot = new Plot(); - -// Set: -plot.width = 720; - -// Get: -var width = plot.width; -// returns 720 -``` - - - -#### Plot.prototype.height - -Plot height (in pixels). - -```javascript -var plot = new Plot(); - -// Set: -plot.height = 480; - -// Get: -var height = plot.height; -// returns 480 -``` - - - -#### Plot.prototype.paddingLeft - -Plot left padding (in pixels). Left padding is typically used to create space for a left-oriented `y`-axis. - -```javascript -var plot = new Plot(); - -// Set: -plot.paddingLeft = 120; - -// Get: -var padding = plot.paddingLeft; -// returns 120 -``` - - - -#### Plot.prototype.paddingRight - -Plot right padding (in pixels). Right padding is typically used to create space for a right-oriented `y`-axis. - -```javascript -var plot = new Plot(); - -// Set: -plot.paddingRight = 90; - -// Get: -var padding = plot.paddingRight; -// returns 90 -``` - - - -#### Plot.prototype.paddingTop - -Plot top padding (in pixels). Top padding is typically used to create space for a title or top-oriented `x`-axis. - -```javascript -var plot = new Plot(); - -// Set: -plot.paddingTop = 100; - -// Get: -var padding = plot.paddingTop; -// returns 100 -``` - - - -#### Plot.prototype.paddingBottom - -Plot bottom padding (in pixels). Bottom padding is typically used to create space for a bottom-oriented `x`-axis. - -```javascript -var plot = new Plot(); - -// Set: -plot.paddingBottom = 105; - -// Get: -var padding = plot.paddingBottom; -// returns 105 -``` - - - -#### Plot.prototype.xMin - -Minimum value of the `x`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. - -```javascript -var plot = new Plot(); - -// Set: -plot.xMin = -1.0; - -// Get: -var xMin = plot.xMin; -// returns -1.0 -``` - - - -#### Plot.prototype.xMax - -Maximum value of the `x`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. - -```javascript -var plot = new Plot(); - -// Set: -plot.xMax = 100.0; - -// Get: -var xMax = plot.xMax; -// returns 100.0 -``` - - - -#### Plot.prototype.yMin - -Minimum value of the `y`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. - -```javascript -var plot = new Plot(); - -// Set: -plot.yMin = -50.0; - -// Get: -var yMin = plot.yMin; -// returns -50.0 -``` - - - -#### Plot.prototype.yMax - -Maximum value of the `y`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. - -```javascript -var plot = new Plot(); - -// Set: -plot.yMax = 31.4; - -// Get: -var yMax = plot.yMax; -// returns 31.4 -``` - - - -#### Plot.prototype.xScale - -Scale function for mapping values to a coordinate along the `x`-axis. The following `scales` are supported: - -- `'linear'`: linear scale. -- `'time'`: time scale. - -To set the scale, - -```javascript -var plot = new Plot(); - -plot.xScale = 'time'; -``` - -When retrieved, the returned value is a scale `function`. - -```javascript -var plot = new Plot(); - -var xScale = plot.xScale; -// returns -``` - - - -#### Plot.prototype.yScale - -Scale function for mapping values to a coordinate along the `y`-axis. The following `scales` are supported: - -- `'linear'`: linear scale. -- `'time'`: time scale. - -To set the scale, - -```javascript -var plot = new Plot(); - -plot.yScale = 'linear'; -``` - -When retrieved, the returned value is a scale `function`. - -```javascript -var plot = new Plot(); - -var yScale = plot.yScale; -// returns -``` - - - -#### Plot.prototype.xTickFormat - -`x`-axis tick format. To set the tick format, - -```javascript -var plot = new Plot({ - 'xScale': 'time' -}); - -plot.xTickFormat = '%H:%M'; -``` - -When retrieved, if the value has not been set to `null`, the returned value is a formatting `function`. - -```javascript -var plot = new Plot({ - 'xScale': 'time', - 'xTickFormat': '%H:%M' -}); - -var fmt = plot.xTickFormat; -// returns -``` - - - -#### Plot.prototype.yTickFormat - -`y`-axis tick format. To set the tick format, - -```javascript -var plot = new Plot({ - 'yScale': 'linear' -}); - -plot.yTickFormat = '.0%'; -``` - -When retrieved, if the value has not been set to `null`, the returned value is a formatting `function`. - -```javascript -var plot = new Plot({ - 'yScale': 'linear', - 'yTickFormat': '.0%' -}); - -var fmt = plot.yTickFormat; -// returns -``` - - - -#### Plot.prototype.xNumTicks - -Number of `x`-axis tick marks. To set the number of tick marks, - -```javascript -var plot = new Plot(); - -// Set: -plot.xNumTicks = 10; - -// Get: -var numTicks = plot.xNumTicks; -// returns 10 -``` - -If the value is set to `null`, the number of tick marks is computed internally. - -```javascript -var plot = new Plot(); - -plot.xNumTicks = null; -``` - - - -#### Plot.prototype.yNumTicks - -Number of `y`-axis tick marks. To set the number of tick marks, - -```javascript -var plot = new Plot(); - -// Set: -plot.yNumTicks = 5; - -// Get: -var numTicks = plot.yNumTicks; -// returns 5 -``` - -If the value is set to `null`, the number of tick marks is computed internally. - -```javascript -var plot = new Plot(); - -plot.yNumTicks = null; -``` - - - -#### Plot.prototype.xAxisOrient - -`x`-axis orientation. The following orientations are supported: - -- `'bottom'` -- `'top'` - -To set the orientation, - -```javascript -var plot = new Plot(); - -// Set: -plot.xAxisOrient = 'top'; - -// Get: -var orient = plot.xAxisOrient; -// returns 'top' -``` - - - -#### Plot.prototype.yAxisOrient - -`y`-axis orientation. The following orientations are supported: - -- `'left'` -- `'right'` - -To set the orientation, - -```javascript -var plot = new Plot(); - -// Set: -plot.yAxisOrient = 'right'; - -// Get: -var orient = plot.yAxisOrient; -// returns 'right' -``` - - - -#### Plot.prototype.xRug - -Boolean flag(s) indicating whether to display a rug plot along the `x`-axis. To set the for flag all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.xRug = true; - -// Get: -var flgs = plot.xRug; -// returns [true] -``` - -To specify the flag for each dataset, provide an `array` of `booleans`. During plot creation, each plotted dataset is assigned a flag. If the number of flags is less than the number of plotted datasets, flags are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.xRug = [ - true, // assigned to datasets 0,2,4,... - false // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.yRug - -Boolean flag(s) indicating whether to display a rug plot along the `y`-axis. To set the for flag all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.yRug = true; - -// Get: -var flgs = plot.yRug; -// returns [true] -``` - -To specify the flag for each dataset, provide an `array` of `booleans`. During plot creation, each plotted dataset is assigned a flag. If the number of flags is less than the number of plotted datasets, flags are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.yRug = [ - false, // assigned to datasets 0,2,4,... - true // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.xRugOrient - -`x`-axis rug orientation. The following orientations are supported: - -- `'bottom'` -- `'top'` - -To set the orientation for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.xRugOrient = 'top'; - -// Get: -var orient = plot.xRugOrient; -// returns ['top'] -``` - -To specify the `x`-axis rug orientation for each dataset, provide an `array` of orientations. During plot creation, each plotted dataset is assigned an orientation. If the number of orientations is less than the number of plotted datasets, orientations are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.xRugOrient = [ - 'bottom', // assigned to datasets 0,2,4,... - 'top' // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.yRugOrient - -`y`-axis rug orientation. The following orientations are supported: - -- `'left'` -- `'right'` - -To set the orientation for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.yRugOrient = 'right'; - -// Get: -var orient = plot.yRugOrient; -// returns ['right'] -``` - -To specify the `y`-axis rug orientation for each dataset, provide an `array` of orientations. During plot creation, each plotted dataset is assigned an orientation. If the number of orientations is less than the number of plotted datasets, orientations are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.yRugOrient = [ - 'left', // assigned to datasets 0,2,4,... - 'right' // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.xRugOpacity - -`x`-axis rug opacity, where an opacity of `0.0` makes a rug completely transparent and an opacity of `1.0` makes a rug completely opaque. To set the opacity for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.xRugOpacity = 0.2; - -// Get: -var opacity = plot.xRugOpacity; -// returns [0.2] -``` - -To specify the `x`-axis rug opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.xRugOpacity = [ - 0.1, // assigned to datasets 0,2,4,... - 1.0 // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.yRugOpacity - -`y`-axis rug opacity, where an opacity of `0.0` makes a rug completely transparent and an opacity of `1.0` makes a rug completely opaque. To set the opacity for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.yRugOpacity = 0.4; - -// Get: -var opacity = plot.yRugOpacity; -// returns [0.4] -``` - -To specify the `y`-axis rug opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.yRugOpacity = [ - 0.7, // assigned to datasets 0,2,4,... - 0.1 // assigned to datasets 1,3,5,... -]; -``` - - - -#### Plot.prototype.xRugSize - -`x`-axis rug tick (tassel) size. To set the tick size for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.xRugSize = 4; - -// Get: -var size = plot.xRugSize; -// returns [4] -``` - -To specify the `x`-axis rug size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a tick size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.xRugSize = [ - 4, // assigned to datasets 0,3,6,... - 6, // assigned to datasets 1,4,7,... - 4 // assigned to datasets 2,5,8,... -]; -``` - - - -#### Plot.prototype.yRugSize - -`y`-axis rug tick (tassel) size. To set the tick size for all plotted datasets, - -```javascript -var plot = new Plot(); - -// Set: -plot.yRugSize = 4; - -// Get: -var size = plot.yRugSize; -// returns [4] -``` - -To specify the `y`-axis rug size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a tick size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. - -```javascript -var plot = new Plot(); - -plot.yRugSize = [ - 6, // assigned to datasets 0,3,6,... - 4, // assigned to datasets 1,4,7,... - 4 // assigned to datasets 2,5,8,... -]; -``` - - - -#### Plot.prototype.description - -Plot description. - -```javascript -var plot = new Plot(); - -// Set: -plot.description = 'A plot of `x` vs `y`.'; - -// Get: -var desc = plot.description; -// returns 'A plot of `x` vs `y`.' -``` - - - -#### Plot.prototype.title - -Plot title. - -```javascript -var plot = new Plot(); - -// Set: -plot.title = 'Time Series'; - -// Get: -var title = plot.title; -// returns 'Time Series' -``` - - - -#### Plot.prototype.xLabel - -`x`-axis label. - -```javascript -var plot = new Plot(); - -// Set: -plot.xLabel = 'time'; - -// Get: -var label = plot.xLabel; -// returns 'time' -``` - - - -#### Plot.prototype.yLabel - -`y`-axis label. - -```javascript -var plot = new Plot(); - -// Set: -plot.yLabel = 'value'; - -// Get: -var label = plot.yLabel; -// returns 'value' -``` - - - -#### Plot.prototype.engine - -Plot rendering engine. The following engines are supported: - -- `'svg'` - -```javascript -var plot = new Plot(); - -// Set: -plot.engine = 'svg'; - -// Get: -var engine = plot.engine; -// returns 'svg' -``` - - - -#### Plot.prototype.renderFormat - -Plot render format. The following formats are supported: - -- `'vdom'` -- `'html'` - -```javascript -var plot = new Plot(); - -// Set: -plot.renderFormat = 'html'; - -// Get: -var fmt = plot.renderFormat; -// returns 'html' -``` - - - -#### Plot.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var plot = new Plot(); - -// Set: -plot.autoRender = false; - -// Get: -var mode = plot.autoRender; -// returns false -``` - - - -#### Plot.prototype.viewer - -Plot viewer. The following viewers are supported: - -- `'none'` -- `'stdout'` -- `'window'` -- `'browser'` - -```javascript -var plot = new Plot(); - -// Set: -plot.viewer = 'window'; - -// Get: -var viewer = plot.viewer; -// returns 'window' -``` - - - -#### Plot.prototype.autoView - -Viewer mode. If `true`, an instance generates an updated view on each `'render'` event; otherwise, generating a view must be triggered manually. - -```javascript -var plot = new Plot(); - -// Set: -plot.autoView = true; - -// Get: -var mode = plot.autoView; -// returns true -``` - -* * * - -### Computed Properties - - - -#### Plot.prototype.graphWidth - -Returns the expected graph width. - -```javascript -var plot = new Plot({ - 'width': 100, - 'paddingLeft': 20, - 'paddingRight': 10 -}); -var width = plot.graphWidth; -// returns 70 -``` - - - -#### Plot.prototype.graphHeight - -Returns the expected graph height. - -```javascript -var plot = new Plot({ - 'height': 500, - 'paddingTop': 10, - 'paddingBottom': 120 -}); -var height = plot.graphHeight; -// returns 370 -``` - - - -#### Plot.prototype.xDomain - -Returns the `x`-axis domain. - -```javascript -var plot = new Plot({ - 'xMin': -1.0, - 'xMax': 1.0 -}); -var domain = plot.xDomain; -// returns [-1.0,1.0] -``` - - - -#### Plot.prototype.yDomain - -Returns the `y`-axis domain. - -```javascript -var plot = new Plot({ - 'yMin': 0.0, - 'yMax': 100.0 -}); -var domain = plot.yDomain; -// returns [0.0,100.0] -``` - - - -#### Plot.prototype.xRange - -Returns the `x`-axis range. - -```javascript -var plot = new Plot({ - 'width': 100, - 'paddingLeft': 10, - 'paddingRight': 10 -}); -var range = plot.xRange; -// returns [0,80] -``` - - - -#### Plot.prototype.yRange - -Returns the `y`-axis range. - -```javascript -var plot = new Plot({ - 'height': 500, - 'paddingTop': 10, - 'paddingBottom': 120 -}); -var range = plot.yRange; -// returns [370,0] -``` - - - -#### Plot.prototype.xPos - -Returns a `function` to map values to `x`-axis coordinate values. - -```javascript -var plot = new Plot(); -var xPos = plot.xPos; -// returns -``` - - - -#### Plot.prototype.yPos - -Returns a `function` to map values to `y`-axis coordinate values. - -```javascript -var plot = new Plot(); -var yPos = plot.yPos; -// returns -``` - - - - - -
- -* * * - -## Examples - - - -```javascript -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var plot = require( '@stdlib/plot/ctor' ); - -var now; -var x; -var y; -var i; - -// Create some data... -now = ( new Date() ).getTime(); -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = now + (i*360000); - y[ i ] = 50.0 + (10.0*randn()); -} - -// Create a new plot: -var h = plot( [x], [y], { - 'width': 600, - 'height': 480, - 'xScale': 'time', - 'xTickFormat': '%H:%M', - 'renderFormat': 'html', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = h.render( 'vdom' ); -console.log( JSON.stringify( vtree ) ); - -// Render as HTML: -var html = h.render(); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -h.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - h.width = 720; -} - -function onRender( html ) { - console.log( html ); -} -``` - -
- - - - - - - - - - - - - - diff --git a/ctor/docs/repl.txt b/ctor/docs/repl.txt deleted file mode 100644 index 3308943..0000000 --- a/ctor/docs/repl.txt +++ /dev/null @@ -1,452 +0,0 @@ - -{{alias}}( [x, y,] [options] ) - Returns a plot instance for creating 2-dimensional plots. - - `x` and `y` arguments take precedence over `x` and `y` options. - - Parameters - ---------- - x: Array|Array (optional) - An array of arrays containing x-coordinate values. - - y: Array|Array (optional) - An array of arrays containing y-coordinate values. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.autoView: boolean (optional) - Boolean indicating whether to generate an updated view on a 'render' - event. Default: false. - - options.colors: string|Array (optional) - Data color(s). Default: 'category10'. - - options.description: string (optional) - Plot description. - - options.engine: string (optional) - Plot engine. Default: 'svg'. - - options.height: number (optional) - Plot height (in pixels). Default: 400. - - options.labels: Array|Array (optional) - Data labels. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.lineStyle: string|Array (optional) - Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'. - Default: '-'. - - options.lineOpacity: number|Array (optional) - Data line opacity. Must be on the interval [0,1]. Default: 0.9. - - options.lineWidth: integer|Array (optional) - Data line width (in pixels). Default: 2. - - options.paddingBottom: integer (optional) - Bottom padding (in pixels). Default: 80. - - options.paddingLeft: integer (optional) - Left padding (in pixels). Default: 90. - - options.paddingRight: integer (optional) - Right padding (in pixels). Default: 20. - - options.paddingTop: integer (optional) - Top padding (in pixels). Default: 80. - - options.renderFormat: string (optional) - Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'. - - options.symbols: string|Array (optional) - Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'. - Default: 'none'. - - options.symbolsOpacity: number|Array (optional) - Symbols opacity. Must be on the interval [0,1]. Default: 0.9. - - options.symbolsSize: integer|Array (optional) - Symbols size (in pixels). Default: 6. - - options.title: string (optional) - Plot title. - - options.viewer: string (optional) - Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window', - or 'none'. Default: 'none'. - - options.width: number (optional) - Plot width (in pixels). Default: 400. - - options.x: Array|Array (optional) - x-coordinate values. - - options.xAxisOrient: string (optional) - x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'. - - options.xLabel: string (optional) - x-axis label. Default: 'x'. - - options.xMax: number|null (optional) - Maximum value of the x-axis domain. If `null`, the maximum value is - calculated from the data. Default: null. - - options.xMin: number|null (optional) - Minimum value of the x-axis domain. If `null`, the minimum value is - calculated from the data. Default: null. - - options.xNumTicks: integer (optional) - Number of x-axis tick marks. Default: 5. - - options.xRug: boolean|Array (optional) - Boolean flag(s) indicating whether to render one or more rug plots along - the x-axis. - - options.xRugOrient: string|Array (optional) - x-axis rug plot orientation(s). Must be either 'bottom' or 'top'. - Default: 'bottom'. - - options.xRugOpacity: number|Array (optional) - x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1. - - options.xRugSize: integer|Array (optional) - x-axis rug tick (tassel) size (in pixels). Default: 6. - - options.xScale: string - x-axis scale. Default: 'linear'. - - options.xTickFormat: string|null - x-axis tick format. Default: null. - - options.y: Array|Array (optional) - y-coordinate values. - - options.yAxisOrient: string (optional) - x-axis orientation. Must be either 'left' or 'right'. Default: 'left'. - - options.yLabel: string (optional) - y-axis label. Default: 'y'. - - options.yMax: number|null (optional) - Maximum value of the y-axis domain. If `null`, the maximum value is - calculated from the data. Default: null. - - options.yMin: number|null (optional) - Minimum value of the y-axis domain. If `null`, the minimum value is - calculated from the data. Default: null. - - options.yNumTicks: integer (optional) - Number of x-axis tick marks. Default: 5. - - options.yRug: boolean|Array (optional) - Boolean flag(s) indicating whether to render one or more rug plots along - the y-axis. - - options.yRugOrient: string|Array (optional) - y-axis rug plot orientation(s). Must be either 'left' or 'right'. - Default: 'left'. - - options.yRugOpacity: number|Array (optional) - y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1. - - options.yRugSize: integer|Array (optional) - y-axis rug tick (tassel) size (in pixels). Default: 6. - - options.yScale: string - y-axis scale. Default: 'linear'. - - options.yTickFormat: string|null - y-axis tick format. Default: null. - - Returns - ------- - plot: Plot - Plot instance. - - plot.render() - Renders a plot as a virtual DOM tree. - - plot.view( [viewer] ) - Generates a plot view. - - plot.x - x-coordinate values. An assigned value must be an array where each - element corresponds to a plotted dataset. - - plot.y - y-coordinate values. An assigned value must be an array, where each - element corresponds to a plotted dataset. - - plot.labels - Data labels. During plot creation, each plotted dataset is assigned a - label. If the number of labels is less than the number of plotted - datasets, labels are reused using modulo arithmetic. - - plot.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - plot.colors - Data colors. To set the color all plotted datasets, provide a color - name. To specify the colors for each dataset, provide an array of - colors. During plot creation, each plotted dataset is assigned one of - the provided colors. If the number of colors is less than the number of - plotted datasets, colors are reused using modulo arithmetic. Lastly, - colors may also be specified by providing the name of a predefined color - scheme. The following schemes are supported: 'category10', 'category20', - 'category20b', and 'category20c'. - - plot.lineStyle - Data line style(s). The following line styles are supported: '-' (solid - line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes - and dots), and 'none' (no line). To specify the line style for each - dataset, provide an array of line styles. During plot creation, each - plotted dataset is assigned a line style. If the number of line styles - is less than the number of plotted datasets, line styles are reused - using modulo arithmetic. - - plot.lineOpacity - Data line opacity, where an opacity of `0.0` make a line completely - transparent and an opacity of `1.0` makes a line completely opaque. To - specify the line opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.lineWidth - Data line width(s). To specify the line width for each dataset, provide - an array of widths. During plot creation, each plotted dataset is - assigned a line width. If the number of line widths is less than the - number of plotted datasets, line widths are reused using modulo - arithmetic. - - plot.symbols - Data symbols. The following symbols are supported: 'closed-circle' - (closed circles), 'open-circle' (open circles), and 'none' (no symbols). - To specify the symbols used for each dataset, provide an array of - symbols. During plot creation, each plotted dataset is assigned a - symbol. If the number of symbols is less than the number of plotted - datasets, symbols are reused using modulo arithmetic. - - plot.symbolSize - Symbols size. To specify the symbols size for each dataset, provide an - array of sizes. During plot creation, each plotted dataset is assigned - a symbols size. If the number of sizes is less than the number of - plotted datasets, sizes are reused using modulo arithmetic. - - plot.symbolsOpacity - Symbols opacity, where an opacity of `0.0` makes a symbol completely - transparent and an opacity of `1.0` makes a symbol completely opaque. To - specify the opacity for each dataset, provide an array of opacities. - During plot creation, each plotted dataset is assigned an opacity. If - the number of opacities is less than the number of plotted datasets, - opacities are reused using modulo arithmetic. - - plot.width - Plot width (in pixels). - - plot.height - Plot height (in pixels). - - plot.paddingLeft - Plot left padding (in pixels). Left padding is typically used to create - space for a left-oriented y-axis. - - plot.paddingRight - Plot right padding (in pixels). Right padding is typically used to - create space for a right-oriented y-axis. - - plot.paddingTop - Plot top padding (in pixels). Top padding is typically used to create - space for a title or top-oriented x-axis. - - plot.paddingBottom - Plot bottom padding (in pixels). Bottom padding is typically used to - create space for a bottom-oriented x-axis. - - plot.xMin - Minimum value of the x-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `x` data. - - plot.xMax - Maximum value of the x-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `x` data. - - plot.yMin - Minimum value of the y-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `y` data. - - plot.yMax - Maximum value of the y-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `y` data. - - plot.xScale - Scale function for mapping values to a coordinate along the x-axis. The - following `scales` are supported: 'linear' (linear scale) and 'time' - (time scale). When retrieved, the returned value is a scale function. - - plot.yScale - Scale function for mapping values to a coordinate along the y-axis. The - following `scales` are supported: 'linear' (linear scale) and 'time' - (time scale). When retrieved, the returned value is a scale function. - - plot.xTickFormat - x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not - been set to `null`, the returned value is a formatting function. - - plot.yTickFormat - y-axis tick format (e.g., '%%'). When retrieved, if the value has not - been set to `null`, the returned value is a formatting function. - - plot.xNumTicks - Number of x-axis tick marks. If the value is set to `null`, the number - of tick marks is computed internally. - - plot.yNumTicks - Number of y-axis tick marks. If the value is set to `null`, the number - of tick marks is computed internally. - - plot.xAxisOrient - x-axis orientation. The following orientations are supported: 'bottom' - and 'top'. - - plot.yAxisOrient - y-axis orientation. The following orientations are supported: 'left' and - 'right'. - - plot.xRug - Boolean flag(s) indicating whether to display a rug plot along the x- - axis. To specify the flag for each dataset, provide an array of - booleans. During plot creation, each plotted dataset is assigned a flag. - If the number of flags is less than the number of plotted datasets, - flags are reused using modulo arithmetic. - - plot.yRug - Boolean flag(s) indicating whether to display a rug plot along the y- - axis. To specify the flag for each dataset, provide an array of - booleans. During plot creation, each plotted dataset is assigned a flag. - If the number of flags is less than the number of plotted datasets, - flags are reused using modulo arithmetic. - - plot.xRugOrient - x-axis rug orientation. The following orientations are supported: - 'bottom' or 'top'. To specify the x-axis rug orientation for each - dataset, provide an array of orientations. During plot creation, each - plotted dataset is assigned an orientation. If the number of - orientations is less than the number of plotted datasets, orientations - are reused using modulo arithmetic. - - plot.yRugOrient - y-axis rug orientation. The following orientations are supported: 'left' - or 'right'. To specify the y-axis rug orientation for each dataset, - provide an array of orientations. During plot creation, each plotted - dataset is assigned an orientation. If the number of orientations is - less than the number of plotted datasets, orientations are reused using - modulo arithmetic. - - plot.xRugOpacity - x-axis rug opacity, where an opacity of `0.0` makes a rug completely - transparent and an opacity of `1.0` makes a rug completely opaque. To - specify the x-axis rug opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.yRugOpacity - y-axis rug opacity, where an opacity of `0.0` makes a rug completely - transparent and an opacity of `1.0` makes a rug completely opaque. To - specify the y-axis rug opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.xRugSize - x-axis rug tick (tassel) size. To specify the x-axis rug size for each - dataset, provide an array of sizes. During plot creation, each plotted - dataset is assigned a tick size. If the number of sizes is less than the - number of plotted datasets, sizes are reused using modulo arithmetic. - - plot.yRugSize - y-axis rug tick (tassel) size. To specify the y-axis rug size for each - dataset, provide an array of sizes. During plot creation, each plotted - dataset is assigned a tick size. If the number of sizes is less than the - number of plotted datasets, sizes are reused using modulo arithmetic. - - plot.description - Plot description. - - plot.title - Plot title. - - plot.xLabel - x-axis label. - - plot.yLabel - y-axis label. - - plot.engine - Plot rendering engine. The following engines are supported: 'svg'. - - plot.renderFormat - Plot render format. The following formats are supported: 'vdom' and - 'html'. - - plot.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - plot.viewer - Plot viewer. The following viewers are supported: 'none', 'stdout', - 'window', and 'browser'. - - plot.autoView - Viewer mode. If `true`, an instance generates an updated view on each - 'render' event; otherwise, generating a view must be triggered manually. - - plot.graphWidth - Computed property corresponding to the expected graph width. - - plot.graphHeight - Computed property corresponding to the expected graph height. - - plot.xDomain - Computed property corresponding to the x-axis domain. - - plot.yDomain - Computed property corresponding to the y-axis domain. - - plot.xRange - Computed property corresponding to the x-axis range. - - plot.yRange - Computed property correspond to the y-axis range. - - plot.xPos - A function which maps values to x-axis coordinate values. - - plot.yPos - A function which maps values to y-axis coordinate values. - - Examples - -------- - > var plot = {{alias}}() - - - // Provide plot data at instantiation: - > var x = [[0.10, 0.20, 0.30]]; - > var y = [[0.52, 0.79, 0.64]]; - > plot = {{alias}}( x, y ) - - - See Also - -------- - diff --git a/ctor/examples/index.js b/ctor/examples/index.js deleted file mode 100644 index 577b117..0000000 --- a/ctor/examples/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randn = require( '@stdlib/random/base/box-muller' ); -var now = require( '@stdlib/time/now' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Plot = require( './../lib' ); - -var t; -var x; -var y; -var i; - -// Create some data... -t = now() * 1000; -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = t + (i*360000); - y[ i ] = 50.0 + (10.0*randn()); -} - -// Create a new plot: -var plot = new Plot( [x], [y], { - 'width': 600, - 'height': 480, - 'xScale': 'time', - 'xTickFormat': '%H:%M', - 'renderFormat': 'html', - 'autoRender': true -}); - -// Render as a virtual DOM tree: -var vtree = plot.render( 'vdom' ); -console.log( JSON.stringify( vtree ) ); - -// Render the plot as HTML: -var html = plot.render(); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -plot.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - plot.width = 720; -} - -function onRender( html ) { - console.log( html ); -} diff --git a/ctor/examples/linescatter b/ctor/examples/linescatter deleted file mode 100644 index 16108ce..0000000 --- a/ctor/examples/linescatter +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Plot = require( './../lib' ); - -var y1; -var y2; -var x; -var i; - -// Create some data... -x = new Float64Array( 100 ); -y1 = new Float64Array( x.length ); -y2 = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = i; - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 10.0 + (5.0*randn()); -} - -// Create a new plot: -var plot = new Plot( [ x, x ], [ y1, y2 ] ); -plot.width = 600; -plot.height = 480; -plot.symbols = [ 'open-circle', 'closed-circle' ]; -plot.symbolsSize = 6; - -// View the plot in a window: -plot.view( 'window' ); diff --git a/ctor/examples/linestyles b/ctor/examples/linestyles deleted file mode 100644 index 4e45dca..0000000 --- a/ctor/examples/linestyles +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Plot = require( './../lib' ); - -var plot; -var opts; -var y1; -var y2; -var y3; -var y4; -var x; -var i; - -// Create some data... -x = new Float64Array( 100 ); -y1 = new Float64Array( x.length ); -y2 = new Float64Array( x.length ); -y3 = new Float64Array( x.length ); -y4 = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = i; - y1[ i ] = 10.0 + (5.0*randn()); - y2[ i ] = 25.0 + (7.25*randn()); - y3[ i ] = 50.0 + (10.0*randn()); - y4[ i ] = 75.0 + (2.5*randn()); -} - -// Set the plot options: -opts = { - 'width': 600, - 'height': 480, - 'colors': '#000', - 'lineOpacity': 0.5, - 'lineWidth': 1, - 'lineStyle': [ - '-', // solid - '--', // dashes - ':', // dotted - '-.' // dash-dot - ], - 'viewer': 'window' -}; - -// Create a new plot: -plot = new Plot( [ x, x, x, x ], [ y1, y2, y3, y4 ], opts ); - -// View the plot: -plot.view(); diff --git a/ctor/examples/multiline b/ctor/examples/multiline deleted file mode 100644 index d997a93..0000000 --- a/ctor/examples/multiline +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Plot = require( './../lib' ); - -var plot; -var y1; -var y2; -var x; -var i; - -// Create some data... -x = new Float64Array( 100 ); -y1 = new Float64Array( x.length ); -y2 = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = i; - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 10.0 + (5.0*randn()); -} - -// Create a new plot: -plot = new Plot( [ x, x ], [ y1, y2 ] ); -plot.width = 600; -plot.height = 480; - -// View the plot in a window: -plot.view( 'window' ); diff --git a/ctor/examples/scatter b/ctor/examples/scatter deleted file mode 100644 index 38a295e..0000000 --- a/ctor/examples/scatter +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Plot = require( './../lib' ); - -var plot; -var opts; -var x1; -var x2; -var y1; -var y2; -var i; - -// Create some data... -x1 = new Float64Array( 1000 ); -x2 = new Float64Array( x1.length ); -y1 = new Float64Array( x1.length ); -y2 = new Float32Array( x1.length ); -for ( i = 0; i < x1.length; i++ ) { - x1[ i ] = 30.0 + (7.5*randn()); - x2[ i ] = 40.0 + (12.5*randn()); - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 30.0 + (5.0*randn()); -} - -// Define the plot options: -opts = { - 'width': 600, - 'height': 480, - 'xMin': 0.0, - 'xMax': 100.0, - 'yMin': 0.0, - 'yMax': 100.0, - 'lineStyle': 'none', - 'symbols': 'closed-circle', - 'symbolsSize': 6, - 'symbolsOpacity': 0.2 -}; - -// Create a new plot: -plot = new Plot( [ x1, x2 ], [ y1, y2 ], opts ); - -// View the plot in a window: -plot.view( 'window' ); diff --git a/ctor/examples/scatterrug b/ctor/examples/scatterrug deleted file mode 100644 index b801e75..0000000 --- a/ctor/examples/scatterrug +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Plot = require( './../lib' ); - -var plot; -var opts; -var x1; -var x2; -var y1; -var y2; -var i; - -// Create some data... -x1 = new Float64Array( 1000 ); -x2 = new Float64Array( x1.length ); -y1 = new Float64Array( x1.length ); -y2 = new Float32Array( x1.length ); -for ( i = 0; i < x1.length; i++ ) { - x1[ i ] = 30.0 + (7.5*randn()); - x2[ i ] = 40.0 + (12.5*randn()); - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 30.0 + (5.0*randn()); -} - -// Define the plot options: -opts = { - 'width': 600, - 'height': 480, - 'xMin': 0.0, - 'xMax': 100.0, - 'yMin': 0.0, - 'yMax': 100.0, - 'lineStyle': 'none', - 'symbols': 'closed-circle', - 'symbolsSize': 6, - 'symbolsOpacity': 0.2, - 'xRug': true, - 'yRug': true, - 'xRugOrient': 'top', - 'yRugOrient': 'right' -}; - -// Create a new plot: -plot = new Plot( [ x1, x2 ], [ y1, y2 ], opts ); - -// View the plot in a window: -plot.view( 'window' ); diff --git a/ctor/examples/timeseries b/ctor/examples/timeseries deleted file mode 100644 index 2d61f50..0000000 --- a/ctor/examples/timeseries +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var now = require( '@stdlib/time/now' ); -var Plot = require( './../lib' ); - -var t; -var x; -var y; -var i; - -// Create some data... -t = now() * 1000; -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = t + (i*360000); - y[ i ] = 50.0 + (10.0*randn()); -} - -// Create a new plot: -var plot = new Plot( [ x ], [ y ] ); -plot.width = 600; -plot.height = 480; -plot.xScale = 'time'; -plot.xTickFormat = '%H:%M'; - -// View the plot in a browser: -plot.view( 'browser' ); diff --git a/ctor/lib/accessors/is_defined.js b/ctor/lib/accessors/is_defined.js deleted file mode 100644 index 727ca23..0000000 --- a/ctor/lib/accessors/is_defined.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'plot:accessor:is-defined' ); - - -// MAIN // - -/** -* Accessor function which determines whether a datum is defined. -* -* @private -* @param {number} d - datum -* @param {integer} i - index -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/ctor/lib/defaults.js b/ctor/lib/defaults.js deleted file mode 100644 index 520790a..0000000 --- a/ctor/lib/defaults.js +++ /dev/null @@ -1,191 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNodeREPL = require( '@stdlib/assert/is-node-repl' ); -var isDefined = require( './accessors/is_defined.js' ); - - -// MAIN // - -/** -* Returns default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var isREPL; - var o; - - isREPL = isNodeREPL(); - o = {}; - - // Boolean indicating whether to re-render on a change event: - o.autoRender = false; - - // Boolean indicating whether to generate an updated view on a render event: - o.autoView = false; - - // Data colors: - o.colors = 'category10'; - - // Plot description: - o.description = ''; - - // Plot engine: - o.engine = 'svg'; - - // Plot height: - o.height = 400; // px - - // Accessor indicating whether a datum is defined: - o.isDefined = isDefined; - - // Data labels: - o.labels = []; - - // Data line opacity: - o.lineOpacity = 0.9; // [0,1] - - // Data line style(s): - o.lineStyle = '-'; - - // Data line width(s): - o.lineWidth = 2; // px - - // FIXME: padding props depend on orientation (may require using `null` to flag) - - // Bottom padding: - o.paddingBottom = 80; // px - - // Left padding: - o.paddingLeft = 90; // px - - // Right padding: - o.paddingRight = 20; // px - - // Top padding: - o.paddingTop = 80; // px - - // Render format: - o.renderFormat = 'vdom'; - - // Data symbols: - o.symbols = 'none'; - - // Symbols opacity: - o.symbolsOpacity = 0.9; // [0,1] - - // Symbols size: - o.symbolsSize = 6; // px - - // Plot title: - o.title = ''; - - // Plot viewer: - if ( isREPL ) { - o.viewer = 'window'; - } else { - o.viewer = 'none'; - } - // Plot width: - o.width = 400; // px - - // x-values: - o.x = []; - - // x-axis orientation: - o.xAxisOrient = 'bottom'; - - // x-axis label: - o.xLabel = 'x'; - - // Maximum value of x-axis domain: - o.xMax = null; - - // Minimum value of x-axis domain: - o.xMin = null; - - // Number of x-axis tick marks: - o.xNumTicks = 5; - - // Boolean indicating whether to render a rug plot along the x-axis: - o.xRug = false; - - // x-axis rug orientation: - o.xRugOrient = 'bottom'; - - // x-axis rug opacity: - o.xRugOpacity = 0.1; // [0,1] - - // x-axis rug tick (tassel) size: - o.xRugSize = 6; // px - - // x-axis scale: - o.xScale = 'linear'; - - // x-axis tick format: - o.xTickFormat = null; - - // y-values: - o.y = []; - - // y-axis orientation: - o.yAxisOrient = 'left'; - - // y-axis label: - o.yLabel = 'y'; - - // Maximum value of y-axis domain: - o.yMax = null; - - // Minimum value of y-axis domain: - o.yMin = null; - - // Number of y-axis tick marks: - o.yNumTicks = 5; - - // Boolean indicating whether to render a rug plot along the y-axis: - o.yRug = false; - - // y-axis rug orientation: - o.yRugOrient = 'left'; - - // y-axis rug opacity: - o.yRugOpacity = 0.1; // [0,1] - - // y-axis rug tick (tassel) size: - o.yRugSize = 6; // px - - // y-axis scale: - o.yScale = 'linear'; - - // y-axis tick format: - o.yTickFormat = null; - - return o; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/ctor/lib/factory.js b/ctor/lib/factory.js deleted file mode 100644 index 4f43c95..0000000 --- a/ctor/lib/factory.js +++ /dev/null @@ -1,80 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isObject = require( '@stdlib/assert/is-plain-object' ); -var format = require( '@stdlib/string/format' ); -var copy = require( '@stdlib/utils/copy' ); -var Plot = require( './main.js' ); - - -// MAIN // - -/** -* Returns a reusable function for generating plots. -* -* @param {Options} [options] - factory options -* TODO -* @throws {TypeError} must provide an object -* @returns {Function} plot function -* -* @example -* var opts = { -* 'width': 600, -* 'height': 400 -* }; -* var plot = factory( opts ); -* var h1 = plot( [[1,2,3]], [[1,0,1]] ); -* var h2 = plot( [[4,5,6]], [[0,1,0]] ); -*/ -function factory( options ) { - var opts; - if ( arguments.length ) { - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - opts = copy( options ); - } else { - opts = {}; - } - return plot; - - /** - * Creates a plot. - * - * @private - * @param {Array} [x] - x-values - * @param {Array} [y] - y-values - * @throws {TypeError} must provide valid options - * @returns {Plot} plot instance - */ - function plot( x, y ) { - if ( arguments.length === 2 ) { - return new Plot( x, y, opts ); - } - return new Plot( opts ); - } -} - - -// EXPORTS // - -module.exports = factory; diff --git a/ctor/lib/index.js b/ctor/lib/index.js deleted file mode 100644 index 8f4246c..0000000 --- a/ctor/lib/index.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a 2-dimensional plot. -* -* @module @stdlib/plot/ctor -* -* @example -* var Plot = require( '@stdlib/plot/ctor' ); -* -* var x = [ 1, 2, 3 ]; -* var y = [ 1, 0, 1 ]; -* -* var p = new Plot( [ x ], [ y ] ); -* -* @example -* var Plot = require( '@stdlib/plot/ctor' ); -* -* var opts = { -* 'width': 600, -* 'height': 400 -* }; -* var myPlot = Plot.factory( opts ); -* -* var h1 = myPlot( [[1,2,3]], [[1,0,1]] ); -* var h2 = myPlot( [[4,5,6]], [[0,1,0]] ); -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var factory = require( './factory.js' ); - - -// MAIN // - -setReadOnly( main, 'factory', factory ); - - -// EXPORTS // - -module.exports = main; diff --git a/ctor/lib/main.js b/ctor/lib/main.js deleted file mode 100644 index bec167a..0000000 --- a/ctor/lib/main.js +++ /dev/null @@ -1,1911 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var copy = require( '@stdlib/utils/copy' ); -var inherit = require( '@stdlib/utils/inherit' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var minstd = require( '@stdlib/random/base/minstd' ); -var format = require( '@stdlib/string/format' ); -var view = require( './view/view.js' ); -var defaults = require( './defaults.js' ); -var setX = require( './props/x/set.js' ); -var getX = require( './props/x/get.js' ); -var setY = require( './props/y/set.js' ); -var getY = require( './props/y/get.js' ); -var setLabels = require( './props/labels/set.js' ); -var getLabels = require( './props/labels/get.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setColors = require( './props/colors/set.js' ); -var getColors = require( './props/colors/get.js' ); -var setLineStyle = require( './props/line-style/set.js' ); -var getLineStyle = require( './props/line-style/get.js' ); -var setLineOpacity = require( './props/line-opacity/set.js' ); -var getLineOpacity = require( './props/line-opacity/get.js' ); -var setLineWidth = require( './props/line-width/set.js' ); -var getLineWidth = require( './props/line-width/get.js' ); -var setSymbols = require( './props/symbols/set.js' ); -var getSymbols = require( './props/symbols/get.js' ); -var setSymbolsSize = require( './props/symbols-size/set.js' ); -var getSymbolsSize = require( './props/symbols-size/get.js' ); -var setSymbolsOpacity = require( './props/symbols-opacity/set.js' ); -var getSymbolsOpacity = require( './props/symbols-opacity/get.js' ); -var setWidth = require( './props/width/set.js' ); -var getWidth = require( './props/width/get.js' ); -var setHeight = require( './props/height/set.js' ); -var getHeight = require( './props/height/get.js' ); -var setPaddingLeft = require( './props/padding-left/set.js' ); -var getPaddingLeft = require( './props/padding-left/get.js' ); -var setPaddingRight = require( './props/padding-right/set.js' ); -var getPaddingRight = require( './props/padding-right/get.js' ); -var setPaddingTop = require( './props/padding-top/set.js' ); -var getPaddingTop = require( './props/padding-top/get.js' ); -var setPaddingBottom = require( './props/padding-bottom/set.js' ); -var getPaddingBottom = require( './props/padding-bottom/get.js' ); -var setXMin = require( './props/x-min/set.js' ); -var getXMin = require( './props/x-min/get.js' ); -var setXMax = require( './props/x-max/set.js' ); -var getXMax = require( './props/x-max/get.js' ); -var setYMin = require( './props/y-min/set.js' ); -var getYMin = require( './props/y-min/get.js' ); -var setYMax = require( './props/y-max/set.js' ); -var getYMax = require( './props/y-max/get.js' ); -var setXScale = require( './props/x-scale/set.js' ); -var getXScale = require( './props/x-scale/get.js' ); -var setYScale = require( './props/y-scale/set.js' ); -var getYScale = require( './props/y-scale/get.js' ); -var setXTickFormat = require( './props/x-tick-format/set.js' ); -var getXTickFormat = require( './props/x-tick-format/get.js' ); -var setYTickFormat = require( './props/y-tick-format/set.js' ); -var getYTickFormat = require( './props/y-tick-format/get.js' ); -var setXNumTicks = require( './props/x-num-ticks/set.js' ); -var getXNumTicks = require( './props/x-num-ticks/get.js' ); -var setYNumTicks = require( './props/y-num-ticks/set.js' ); -var getYNumTicks = require( './props/y-num-ticks/get.js' ); -var setXAxisOrient = require( './props/x-axis-orient/set.js' ); -var getXAxisOrient = require( './props/x-axis-orient/get.js' ); -var setYAxisOrient = require( './props/y-axis-orient/set.js' ); -var getYAxisOrient = require( './props/y-axis-orient/get.js' ); -var setXRug = require( './props/x-rug/set.js' ); -var getXRug = require( './props/x-rug/get.js' ); -var setYRug = require( './props/y-rug/set.js' ); -var getYRug = require( './props/y-rug/get.js' ); -var setXRugOrient = require( './props/x-rug-orient/set.js' ); -var getXRugOrient = require( './props/x-rug-orient/get.js' ); -var setYRugOrient = require( './props/y-rug-orient/set.js' ); -var getYRugOrient = require( './props/y-rug-orient/get.js' ); -var setXRugOpacity = require( './props/x-rug-opacity/set.js' ); -var getXRugOpacity = require( './props/x-rug-opacity/get.js' ); -var setYRugOpacity = require( './props/y-rug-opacity/set.js' ); -var getYRugOpacity = require( './props/y-rug-opacity/get.js' ); -var setXRugSize = require( './props/x-rug-size/set.js' ); -var getXRugSize = require( './props/x-rug-size/get.js' ); -var setYRugSize = require( './props/y-rug-size/set.js' ); -var getYRugSize = require( './props/y-rug-size/get.js' ); -var setDescription = require( './props/description/set.js' ); -var getDescription = require( './props/description/get.js' ); -var setTitle = require( './props/title/set.js' ); -var getTitle = require( './props/title/get.js' ); -var setXLabel = require( './props/x-label/set.js' ); -var getXLabel = require( './props/x-label/get.js' ); -var setYLabel = require( './props/y-label/set.js' ); -var getYLabel = require( './props/y-label/get.js' ); -var setEngine = require( './props/engine/set.js' ); -var getEngine = require( './props/engine/get.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var setRenderFormat = require( './props/render-format/set.js' ); -var getRenderFormat = require( './props/render-format/get.js' ); -var setViewer = require( './props/viewer/set.js' ); -var getViewer = require( './props/viewer/get.js' ); -var setAutoView = require( './props/auto-view/set.js' ); -var getAutoView = require( './props/auto-view/get.js' ); -var getGraphWidth = require( './props/graph-width/get.js' ); -var getGraphHeight = require( './props/graph-height/get.js' ); -var getXDomain = require( './props/x-domain/get.js' ); -var getYDomain = require( './props/y-domain/get.js' ); -var getXRange = require( './props/x-range/get.js' ); -var getYRange = require( './props/y-range/get.js' ); -var getXPos = require( './props/x-pos/get.js' ); -var getYPos = require( './props/y-pos/get.js' ); -var render = require( './render' ); -var viewMethod = require( './view' ); - - -// VARIABLES // - -var debug = logger( 'plot:main' ); -var PRIVATE_PROPS = [ - '_autoRender', - '_autoView', - '_colors', - '_description', - '_engine', - '_height', - '_isDefined', - '_labels', - '_lineOpacity', - '_lineStyle', - '_lineWidth', - '_paddingBottom', - '_paddingLeft', - '_paddingRight', - '_paddingTop', - '_renderFormat', - '_symbols', - '_symbolsOpacity', - '_symbolsSize', - '_title', - '_viewer', - '_width', - '_xAxisOrient', - '_xData', - '_xLabel', - '_xMax', - '_xMin', - '_xNumTicks', - '_xRug', - '_xRugOpacity', - '_xRugOrient', - '_xRugSize', - '_xScale', - '_xTickFormat', - '_yAxisOrient', - '_yData', - '_yLabel', - '_yMax', - '_yMin', - '_yNumTicks', - '_yRug', - '_yRugOpacity', - '_yRugOrient', - '_yRugSize', - '_yScale', - '_yTickFormat' -]; - - -// FUNCTIONS // - -var merge = mergeFcn({ - 'extend': false -}); - - -// MAIN // - -/** -* Plot constructor. -* -* @constructor -* @param {Array} [x] - x-values -* @param {Array} [y] - y-values -* @param {Options} [options] - constructor options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @param {boolean} [options.autoView=false] - indicates whether to generate an updated view on a render event -* @param {(string|StringArray)} [options.colors='category10'] - data colors -* @param {string} [options.description=''] - plot description -* @param {string} [options.engine='svg'] - plot engine -* @param {PositiveNumber} [options.height=400] - plot height -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {(StringArray|EmptyArray)} [options.labels] - data labels -* @param {(number|NumberArray)} [options.lineOpacity=0.9] - data line opacity -* @param {(string|StringArray)} [options.lineStyle='-'] - data line style(s) -* @param {(NonNegativeInteger|Array)} [options.lineWidth=2] - data line width(s) -* @param {NonNegativeInteger} [options.paddingBottom=80] - bottom padding -* @param {NonNegativeInteger} [options.paddingLeft=90] - left padding -* @param {NonNegativeInteger} [options.paddingRight=20] - right padding -* @param {NonNegativeInteger} [options.paddingTop=80] - top padding -* @param {string} [options.renderFormat='vdom'] - plot render format -* @param {(string|StringArray)} [options.symbols='none'] - data symbols -* @param {(number|NumberArray)} [options.symbolsOpacity=0.9] - symbols opacity -* @param {(NonNegativeInteger|Array)} [options.symbolsSize=6] - symbols size -* @param {string} [options.title=''] - plot title -* @param {string} [options.viewer='none'] - plot viewer -* @param {PositiveNumber} [options.width=400] - plot width -* @param {Array} [options.x=[]] - x-values -* @param {string} [options.xAxisOrient='bottom'] - x-axis orientation -* @param {string} [options.xLabel='x'] - x-axis label -* @param {(Date|FiniteNumber|null)} [options.xMax=null] - maximum value of x-axis domain -* @param {(Date|FiniteNumber|null)} [options.xMin=null] - minimum value of x-axis domain -* @param {(NonNegativeInteger|null)} [options.xNumTicks=5] - number of x-axis tick marks -* @param {(boolean|BooleanArray)} [options.xRug=false] - indicates whether to render a rug plot along the x-axis -* @param {(string|StringArray)} [options.xRugOrient='bottom'] - x-axis rug orientation -* @param {(number|NumberArray)} [options.xRugOpacity=0.1] - x-axis rug opacity -* @param {(NonNegativeInteger|Array)} [options.xRugSize=6] - x-axis rug tick (tassel) size -* @param {string} [options.xScale='linear'] - x-axis scale -* @param {(string|null)} [options.xTickFormat=null] - x-axis tick format -* @param {Array} [options.y=[]] - y-values -* @param {string} [options.yAxisOrient='left'] - y-axis orientation -* @param {string} [options.yLabel='y'] - y-axis label -* @param {(FiniteNumber|null)} [options.yMax=null] - maximum value of y-axis domain -* @param {(FiniteNumber|null)} [options.yMin=null] - minimum value of y-axis domain -* @param {(NonNegativeInteger|null)} [options.yNumTicks=5] - number of y-axis tick marks -* @param {(boolean|BooleanArray)} [options.yRug=false] - indicates whether to render a rug plot along the y-axis -* @param {(string|StringArray)} [options.yRugOrient='left'] - y-axis rug orientation -* @param {(number|NumberArray)} [options.yRugOpacity=0.1] - y-axis rug opacity -* @param {(NonNegativeInteger|Array)} [options.yRugSize=6] - y-axis rug tick (tassel) size -* @param {string} [options.yScale='linear'] - y-axis scale -* @param {(string|null)} [options.yTickFormat=null] - y-axis tick format -* @throws {TypeError} must provide valid options -* @returns {Plot} Plot instance -* -* @example -* var plot = new Plot(); -*/ -function Plot() { - var options; - var nargs; - var keys; - var self; - var opts; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof Plot) ) { - if ( nargs === 0 ) { - return new Plot(); - } - if ( nargs === 1 ) { - return new Plot( arguments[0] ); - } - if ( nargs === 2 ) { - return new Plot( arguments[0], arguments[1] ); - } - return new Plot( arguments[0], arguments[1], arguments[2] ); - } - self = this; - - opts = defaults(); - if ( nargs === 0 ) { - options = {}; - } else if ( nargs === 1 ) { - options = arguments[ 0 ]; - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - } else if ( nargs === 2 ) { - options = { - 'x': arguments[ 0 ], - 'y': arguments[ 1 ] - }; - } else if ( nargs > 2 ) { - if ( !isObject( arguments[2] ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', arguments[2] ) ); - } - options = copy( arguments[2] ); // avoid mutation - options.x = arguments[ 0 ]; - options.y = arguments[ 1 ]; - } - opts = merge( opts, options ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - // Set a clipping path id: - defineProperty( this, '_clipPathId', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': minstd().toString() // TODO: uuid - }); - - // Initialize an internal cache for renderers... - defineProperty( this, '$', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': {} - }); - defineProperty( this.$, 'svg', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': {} - }); - - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - // Add event listeners: - this.on( 'change', onChange ); - this.on( 'render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a change event. - * - * @private - */ - function onChange() { - /* eslint-disable no-underscore-dangle */ - debug( 'Received a change event.' ); - if ( self._autoRender ) { - self.render(); - } - } - - /** - * Callback invoked upon receiving a render event. - * - * @private - * @param {*} plot - rendered plot - */ - function onRender( plot ) { - /* eslint-disable no-underscore-dangle */ - debug( 'Received a render event.' ); - if ( self._autoView ) { - debug( 'Viewer: %s.', self._viewer ); - debug( 'Generating view...' ); - view( self, self._viewer, plot ); - } - } -} - -/* -* Inherit from the `EventEmitter` prototype. -*/ -inherit( Plot, EventEmitter ); - -/** -* `x` values. -* -* @name x -* @memberof Plot.prototype -* @type {Array} -* @throws {TypeError} must be an array -* @default [] -* -* @example -* var plot = new Plot(); -* plot.x = [ [ 1417563950959, 1417563952959 ] ]; -* -* @example -* var plot = new Plot({ -* 'x': [ [ 1417563950959, 1417563952959 ] ] -* }); -* var x = plot.x; -* // returns [ [ 1417563950959, 1417563952959 ] ] -*/ -defineProperty( Plot.prototype, 'x', { - 'configurable': false, - 'enumerable': true, - 'set': setX, - 'get': getX -}); - -/** -* `y` values. -* -* @name y -* @memberof Plot.prototype -* @type {Array} -* @throws {TypeError} must be an array -* @default [] -* -* @example -* var plot = new Plot(); -* plot.x = [ [ 1417563950959, 1417563952959 ] ]; -* plot.y = [ [ 0.25, 0.23 ] ]; -* -* @example -* var plot = new Plot({ -* 'x': [ [ 1417563950959, 1417563952959 ] ], -* 'y': [ [ 0.25, 0.23 ] ] -* }); -* var y = plot.y; -* // returns [ [ 0.25, 0.23 ] ] -*/ -defineProperty( Plot.prototype, 'y', { - 'configurable': false, - 'enumerable': true, - 'set': setY, - 'get': getY -}); - -/** -* Data labels. -* -* @name labels -* @memberof Plot.prototype -* @type {(StringArray|EmptyArray)} -* @throws {TypeError} must be either an array of strings or an empty array -* @default [] -* -* @example -* var plot = new Plot(); -* plot.labels = [ 'beep', 'boop' ]; -* -* @example -* var plot = new Plot({ -* 'labels': [ 'beep', 'boop' ] -* }); -* var labels = plot.labels; -* // returns [ 'beep', 'boop' ] -*/ -defineProperty( Plot.prototype, 'labels', { - 'configurable': false, - 'enumerable': true, - 'set': setLabels, - 'get': getLabels -}); - -/** -* Accessor which defines whether a datum is defined. -* -* ## Notes -* -* - This accessor is used to define how missing values are encoded. -* - The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Plot.prototype -* @type {Function} -* @param {*} d - datum -* @param {integer} i - index -* @throws {TypeError} must be a function -* -* @example -* var plot = new Plot(); -* plot.isDefined = function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* var plot = new Plot({ -* 'isDefined': isDefined -* }); -* var fcn = plot.isDefined; -* // returns -*/ -defineProperty( Plot.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* Data colors. When retrieved, the returned value is always an `array`. -* -* @name colors -* @memberof Plot.prototype -* @type {(string|StringArray)} -* @throws {TypeError} must be either a string or an array of strings -* @default 'category10' -* -* @example -* var plot = new Plot(); -* plot.colors = 'category20'; -* -* @example -* var plot = new Plot({ -* 'colors': 'category20' -* }); -* var colors = plot.colors; -* // returns [...] -*/ -defineProperty( Plot.prototype, 'colors', { - 'configurable': false, - 'enumerable': true, - 'set': setColors, - 'get': getColors -}); - -/** -* Data line style(s). -* -* ## Notes -* -* - When retrieved, the returned value is always an `array`. -* -* @name lineStyle -* @memberof Plot.prototype -* @type {(string|StringArray)} -* @throws {TypeError} must be a string or string array -* @throws {Error} must be a supported line style -* @default '-' -* -* @example -* var plot = new Plot(); -* plot.lineStyle = [ '-', 'none' ]; -* -* @example -* var plot = new Plot({ -* 'lineStyle': 'none' -* }); -* var lineStyle = plot.lineStyle; -* // returns [ 'none' ] -*/ -defineProperty( Plot.prototype, 'lineStyle', { - 'configurable': false, - 'enumerable': true, - 'set': setLineStyle, - 'get': getLineStyle -}); - -/** -* Data line opacity. -* -* ## Notes -* -* - When retrieved, the returned value is always an `array`. -* -* @name lineOpacity -* @memberof Plot.prototype -* @type {(number|NumberArray)} -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default '0.9' -* -* @example -* var plot = new Plot(); -* plot.lineOpacity = [ 1.0, 0.5 ]; -* -* @example -* var plot = new Plot({ -* 'lineOpacity': 0.5 -* }); -* var opacity = plot.lineOpacity; -* // returns [ 0.5 ] -*/ -defineProperty( Plot.prototype, 'lineOpacity', { - 'configurable': false, - 'enumerable': true, - 'set': setLineOpacity, - 'get': getLineOpacity -}); - -/** -* Data line width. -* -* ## Notes -* -* - When retrieved, the returned value is always an `array`. -* -* @name lineWidth -* @memberof Plot.prototype -* @type {(NonNegativeInteger|NonNegativeIntegerArray)} -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @default 2 -* -* @example -* var plot = new Plot(); -* plot.lineWidth = 1; -* -* @example -* var plot = new Plot({ -* 'lineWidth': [ 1, 3 ] -* }); -* var width = plot.lineWidth; -* // returns [ 1, 3 ] -*/ -defineProperty( Plot.prototype, 'lineWidth', { - 'configurable': false, - 'enumerable': true, - 'set': setLineWidth, - 'get': getLineWidth -}); - -/** -* Data symbols. When retrieved, the returned value is always an `array`. -* -* @name symbols -* @memberof Plot.prototype -* @type {(string|StringArray)} -* @throws {TypeError} must be a string or string array -* @throws {Error} must be a supported symbol -* @default 'none' -* -* @example -* var plot = new Plot(); -* plot.symbols = [ 'open-circle', 'closed-circle' ]; -* -* @example -* var plot = new Plot({ -* 'symbols': 'closed-circle' -* }); -* var symbols = plot.symbols; -* // returns [ 'closed-circle' ] -*/ -defineProperty( Plot.prototype, 'symbols', { - 'configurable': false, - 'enumerable': true, - 'set': setSymbols, - 'get': getSymbols -}); - -/** -* Symbols size. When retrieved, the returned value is always an `array`. -* -* @name symbolsSize -* @memberof Plot.prototype -* @type {(NonNegativeInteger|NonNegativeIntegerArray)} -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @default 6 -* -* @example -* var plot = new Plot(); -* plot.symbolsSize = 4; -* -* @example -* var plot = new Plot({ -* 'symbolsSize': [ 4, 6 ] -* }); -* var size = plot.symbolsSize; -* // returns [ 4, 6 ] -*/ -defineProperty( Plot.prototype, 'symbolsSize', { - 'configurable': false, - 'enumerable': true, - 'set': setSymbolsSize, - 'get': getSymbolsSize -}); - -/** -* Symbols opacity. When retrieved, the returned value is always an `array`. -* -* @name symbolsOpacity -* @memberof Plot.prototype -* @type {(number|NumberArray)} -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.9 -* -* @example -* var plot = new Plot(); -* plot.symbolsOpacity = [ 0.2, 0.5 ]; -* -* @example -* var plot = new Plot({ -* 'symbolsOpacity': 0.2 -* }); -* var opacity = plot.symbolsOpacity; -* // returns [ 0.2 ] -*/ -defineProperty( Plot.prototype, 'symbolsOpacity', { - 'configurable': false, - 'enumerable': true, - 'set': setSymbolsOpacity, - 'get': getSymbolsOpacity -}); - -/** -* Plot width. -* -* @name width -* @memberof Plot.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 (px) -* -* @example -* var plot = new Plot(); -* plot.width = 100; -* -* @example -* var plot = new Plot({ -* 'width': 480 -* }); -* var width = plot.width; -* // returns 480 -*/ -defineProperty( Plot.prototype, 'width', { - 'configurable': false, - 'enumerable': true, - 'set': setWidth, - 'get': getWidth -}); - -/** -* Plot height. -* -* @name height -* @memberof Plot.prototype -* @type {PositiveNumber} -* @throws {TypeError} must be a positive number -* @default 400 (px) -* -* @example -* var plot = new Plot(); -* plot.height = 100; -* -* @example -* var plot = new Plot({ -* 'height': 360 -* }); -* var height = plot.height; -* // returns 360 -*/ -defineProperty( Plot.prototype, 'height', { - 'configurable': false, - 'enumerable': true, - 'set': setHeight, - 'get': getHeight -}); - -/** -* Plot left padding. -* -* ## Notes -* -* - Typically used to create space for a left-oriented y-axis. -* -* @name paddingLeft -* @memberof Plot.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 90 (px) -* -* @example -* var plot = new Plot(); -* plot.paddingLeft = 100; -* -* @example -* var plot = new Plot({ -* 'paddingLeft': 100 -* }); -* var padding = plot.paddingLeft; -* // returns 100 -*/ -defineProperty( Plot.prototype, 'paddingLeft', { - 'configurable': false, - 'enumerable': true, - 'set': setPaddingLeft, - 'get': getPaddingLeft -}); - -/** -* Plot right padding. -* -* ## Notes -* -* - Typically used to create space for a right-oriented y-axis. -* -* @name paddingRight -* @memberof Plot.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 20 (px) -* -* @example -* var plot = new Plot(); -* plot.paddingRight = 100; -* -* @example -* var plot = new Plot({ -* 'paddingRight': 100 -* }); -* var padding = plot.paddingRight; -* // returns 100 -*/ -defineProperty( Plot.prototype, 'paddingRight', { - 'configurable': false, - 'enumerable': true, - 'set': setPaddingRight, - 'get': getPaddingRight -}); - -/** -* Plot top padding. -* -* ## Notes -* -* - Typically used to create space for a title or top-oriented x-axis. -* -* @name paddingTop -* @memberof Plot.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 80 (px) -* -* @example -* var plot = new Plot(); -* plot.paddingTop = 100; -* -* @example -* var plot = new Plot({ -* 'paddingTop': 100 -* }); -* var padding = plot.paddingTop; -* // returns 100 -*/ -defineProperty( Plot.prototype, 'paddingTop', { - 'configurable': false, - 'enumerable': true, - 'set': setPaddingTop, - 'get': getPaddingTop -}); - -/** -* Plot bottom padding. -* -* ## Notes -* -* - Typically used to create space for a bottom-oriented y-axis. -* -* @name paddingBottom -* @memberof Plot.prototype -* @type {NonNegativeInteger} -* @throws {TypeError} must be a nonnegative integer -* @default 80 (px) -* -* @example -* var plot = new Plot(); -* plot.paddingBottom = 100; -* -* @example -* var plot = new Plot({ -* 'paddingBottom': 100 -* }); -* var padding = plot.paddingBottom; -* // returns 100 -*/ -defineProperty( Plot.prototype, 'paddingBottom', { - 'configurable': false, - 'enumerable': true, - 'set': setPaddingBottom, - 'get': getPaddingBottom -}); - -/** -* Minimum value of the x-axis domain. -* -* ## Notes -* -* - When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. -* -* @name xMin -* @memberof Plot.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.xMin = -1.0; -* -* @example -* var plot = new Plot({ -* 'xMin': -10.0 -* }); -* var xmin = plot.xMin; -* // returns -10.0 -*/ -defineProperty( Plot.prototype, 'xMin', { - 'configurable': false, - 'enumerable': true, - 'set': setXMin, - 'get': getXMin -}); - -/** -* Maximum value of the x-axis domain. -* -* ## Notes -* -* - When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. -* -* @name xMax -* @memberof Plot.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.xMax = 100.0; -* -* @example -* var plot = new Plot({ -* 'xMax': 10.0 -* }); -* var xmax = plot.xMax; -* // returns 10.0 -*/ -defineProperty( Plot.prototype, 'xMax', { - 'configurable': false, - 'enumerable': true, - 'set': setXMax, - 'get': getXMax -}); - -/** -* Minimum value of the y-axis domain. -* -* ## Notes -* -* - When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. -* -* @name yMin -* @memberof Plot.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.yMin = -100.0; -* -* @example -* var plot = new Plot({ -* 'yMin': 3.14 -* }); -* var ymin = plot.yMin; -* // returns 3.14 -*/ -defineProperty( Plot.prototype, 'yMin', { - 'configurable': false, - 'enumerable': true, - 'set': setYMin, - 'get': getYMin -}); - -/** -* Maximum value of the y-axis domain. -* -* ## Notes -* -* - When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. -* -* @name yMax -* @memberof Plot.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.yMax = 100.0; -* -* @example -* var plot = new Plot({ -* 'yMax': 31.4 -* }); -* var ymax = plot.yMax; -* // returns 31.4 -*/ -defineProperty( Plot.prototype, 'yMax', { - 'configurable': false, - 'enumerable': true, - 'set': setYMax, - 'get': getYMax -}); - -/** -* Scale function for mapping values to a coordinate along the x-axis. When retrieved, the returned value is a scale function. -* -* @name xScale -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default 'linear' -* -* @example -* var plot = new Plot(); -* plot.xScale = 'time'; -* -* @example -* var plot = new Plot({ -* 'xScale': 'time' -* }); -* var scale = plot.xScale; -* // returns -*/ -defineProperty( Plot.prototype, 'xScale', { - 'configurable': false, - 'enumerable': true, - 'set': setXScale, - 'get': getXScale -}); - -/** -* Scale function for mapping values to a coordinate along the y-axis. When retrieved, the returned value is a scale function. -* -* @name yScale -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default 'linear' -* -* @example -* var plot = new Plot(); -* plot.yScale = 'linear'; -* -* @example -* var plot = new Plot({ -* 'yScale': 'linear' -* }); -* var scale = plot.yScale; -* // returns -*/ -defineProperty( Plot.prototype, 'yScale', { - 'configurable': false, - 'enumerable': true, - 'set': setYScale, - 'get': getYScale -}); - -/** -* x-axis tick format. -* -* ## Notes -* -* - When retrieved, if the value is not `null`, the returned value is a formatting function. -* -* @name xTickFormat -* @memberof Plot.prototype -* @type {(string|null)} -* @throws {TypeError} must be a string or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.xScale = 'time'; -* plot.xTickFormat = '%H:%M'; -* -* @example -* var plot = new Plot({ -* 'xScale': 'time', -* 'xTickFormat': '%H:%M' -* }); -* var fmt = plot.xTickFormat; -* // returns -*/ -defineProperty( Plot.prototype, 'xTickFormat', { - 'configurable': false, - 'enumerable': true, - 'set': setXTickFormat, - 'get': getXTickFormat -}); - -/** -* y-axis tick format. -* -* ## Notes -* -* - If the value is not `null`, when retrieved, the returned value is a formatting function. -* -* @name yTickFormat -* @memberof Plot.prototype -* @type {(string|null)} -* @throws {TypeError} must be a string or null -* @default null -* -* @example -* var plot = new Plot(); -* plot.yTickFormat = '.0%'; -* -* @example -* var plot = new Plot({ -* 'yTickFormat': '.0%' -* }); -* var fmt = plot.yTickFormat; -* // returns -*/ -defineProperty( Plot.prototype, 'yTickFormat', { - 'configurable': false, - 'enumerable': true, - 'set': setYTickFormat, - 'get': getYTickFormat -}); - -/** -* Number of x-axis tick marks. -* -* @name xNumTicks -* @memberof Plot.prototype -* @type {(NonNegativeInteger|null)} -* @throws {TypeError} must be a nonnegative integer or null -* @default 5 -* -* @example -* var plot = new Plot(); -* plot.xNumTicks = 10; -* -* @example -* var plot = new Plot({ -* 'xNumTicks': 10 -* }); -* var ticks = plot.xNumTicks; -* // returns 10 -*/ -defineProperty( Plot.prototype, 'xNumTicks', { - 'configurable': false, - 'enumerable': true, - 'set': setXNumTicks, - 'get': getXNumTicks -}); - -/** -* Number of y-axis tick marks. -* -* @name yNumTicks -* @memberof Plot.prototype -* @type {(NonNegativeInteger|null)} -* @throws {TypeError} must be a nonnegative integer or null -* @default 5 -* -* @example -* var plot = new Plot(); -* plot.yNumTicks = 10; -* -* @example -* var plot = new Plot({ -* 'yNumTicks': 10 -* }); -* var ticks = plot.yNumTicks; -* // returns 10 -*/ -defineProperty( Plot.prototype, 'yNumTicks', { - 'configurable': false, - 'enumerable': true, - 'set': setYNumTicks, - 'get': getYNumTicks -}); - -/** -* x-axis orientation. -* -* @name xAxisOrient -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be either `'top'` or `'bottom'` -* @default 'bottom' -* -* @example -* var plot = new Plot(); -* plot.xAxisOrient = 'bottom'; -* -* @example -* var plot = new Plot({ -* 'xAxisOrient': 'bottom' -* }); -* var orientation = plot.xAxisOrient; -* // returns 'bottom' -*/ -defineProperty( Plot.prototype, 'xAxisOrient', { - 'configurable': false, - 'enumerable': true, - 'set': setXAxisOrient, - 'get': getXAxisOrient -}); - -/** -* y-axis orientation. -* -* @name yAxisOrient -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be either `'left'` or `'right'` -* @default 'left' -* -* @example -* var plot = new Plot(); -* plot.yAxisOrient = 'left'; -* -* @example -* var plot = new Plot({ -* 'yAxisOrient': 'left' -* }); -* var orientation = plot.yAxisOrient; -* // returns 'left' -*/ -defineProperty( Plot.prototype, 'yAxisOrient', { - 'configurable': false, - 'enumerable': true, - 'set': setYAxisOrient, - 'get': getYAxisOrient -}); - -/** -* Boolean flag(s) indicating whether to display a rug plot along the x-axis. When retrieved, the returned value is always an `array`. -* -* @name xRug -* @memberof Plot.prototype -* @type {(boolean|BooleanArray)} -* @throws {TypeError} must be a boolean or boolean array -* @default false -* -* @example -* var plot = new Plot({ -* 'xRug': true -* }); -* -* var bool = plot.xRug; -* // returns [ true ] -*/ -defineProperty( Plot.prototype, 'xRug', { - 'configurable': false, - 'enumerable': true, - 'set': setXRug, - 'get': getXRug -}); - -/** -* Boolean flag(s) indicating whether to display a rug plot along the y-axis. When retrieved, the returned value is always an `array`. -* -* @name yRug -* @memberof Plot.prototype -* @type {(boolean|BooleanArray)} -* @throws {TypeError} must be a boolean or boolean array -* @default false -* -* @example -* var plot = new Plot({ -* 'yRug': true -* }); -* -* var bool = plot.yRug; -* // returns [ true ] -*/ -defineProperty( Plot.prototype, 'yRug', { - 'configurable': false, - 'enumerable': true, - 'set': setYRug, - 'get': getYRug -}); - -/** -* x-axis rug orientation. When retrieved, the returned value is always an `array`. -* -* @name xRugOrient -* @memberof Plot.prototype -* @type {(string|StringArray)} -* @throws {TypeError} must be a string or string array -* @throws {TypeError} must be either `'top'` or `'bottom'` -* @default 'bottom' -* -* @example -* var plot = new Plot(); -* plot.xRugOrient = [ 'bottom', 'top' ]; -* -* @example -* var plot = new Plot({ -* 'xRugOrient': 'bottom' -* }); -* var orientation = plot.xRugOrient; -* // returns [ 'bottom' ] -*/ -defineProperty( Plot.prototype, 'xRugOrient', { - 'configurable': false, - 'enumerable': true, - 'set': setXRugOrient, - 'get': getXRugOrient -}); - -/** -* y-axis rug orientation. When retrieved, the returned value is always an `array`. -* -* @name yRugOrient -* @memberof Plot.prototype -* @type {(string|StringArray)} -* @throws {TypeError} must be a string or string array -* @throws {TypeError} must be either `'left'` or `'right'` -* @default 'left' -* -* @example -* var plot = new Plot(); -* plot.yRugOrient = [ 'right', 'left' ]; -* -* @example -* var plot = new Plot({ -* 'yRugOrient': 'left' -* }); -* var orientation = plot.yRugOrient; -* // returns [ 'left' ] -*/ -defineProperty( Plot.prototype, 'yRugOrient', { - 'configurable': false, - 'enumerable': true, - 'set': setYRugOrient, - 'get': getYRugOrient -}); - -/** -* x-axis rug opacity. When retrieved, the returned value is always an `array`. -* -* @name xRugOpacity -* @memberof Plot.prototype -* @type {(number|NumberArray)} -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.1 -* -* @example -* var plot = new Plot(); -* plot.xRugOpacity = [ 0.1, 0.5 ]; -* -* @example -* var plot = new Plot({ -* 'xRugOpacity': 0.1 -* }); -* var opacity = plot.xRugOpacity; -* // returns [ 0.1 ] -*/ -defineProperty( Plot.prototype, 'xRugOpacity', { - 'configurable': false, - 'enumerable': true, - 'set': setXRugOpacity, - 'get': getXRugOpacity -}); - -/** -* y-axis rug opacity. When retrieved, the returned value is always an `array`. -* -* @name yRugOpacity -* @memberof Plot.prototype -* @type {(number|NumberArray)} -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @default 0.1 -* -* @example -* var plot = new Plot(); -* plot.yRugOpacity = [ 0.1, 0.5 ]; -* -* @example -* var plot = new Plot({ -* 'yRugOpacity': 0.1 -* }); -* var opacity = plot.yRugOpacity; -* // returns [ 0.1 ] -*/ -defineProperty( Plot.prototype, 'yRugOpacity', { - 'configurable': false, - 'enumerable': true, - 'set': setYRugOpacity, - 'get': getYRugOpacity -}); - -/** -* x-axis rug tick (tassel) size. When retrieved, the returned value is always an `array`. -* -* @name xRugSize -* @memberof Plot.prototype -* @type {(NonNegativeInteger|Array)} -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @default 6 -* -* @example -* var plot = new Plot(); -* plot.xRugSize = [ 4, 6 ]; -* -* @example -* var plot = new Plot({ -* 'xRugSize': 4 -* }); -* var size = plot.xRugSize; -* // returns [ 4 ] -*/ -defineProperty( Plot.prototype, 'xRugSize', { - 'configurable': false, - 'enumerable': true, - 'set': setXRugSize, - 'get': getXRugSize -}); - -/** -* y-axis rug tick (tassel) size. When retrieved, the returned value is always an `array`. -* -* @name yRugSize -* @memberof Plot.prototype -* @type {(NonNegativeInteger|Array)} -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @default 6 -* -* @example -* var plot = new Plot(); -* plot.yRugSize = [ 4, 6 ]; -* -* @example -* var plot = new Plot({ -* 'yRugSize': 4 -* }); -* var size = plot.yRugSize; -* // returns [ 4 ] -*/ -defineProperty( Plot.prototype, 'yRugSize', { - 'configurable': false, - 'enumerable': true, - 'set': setYRugSize, - 'get': getYRugSize -}); - -/** -* Plot description. -* -* @name description -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default '' -* -* @example -* var plot = new Plot(); -* plot.description = 'Average stock market index covering the last 100 years.'; -* -* @example -* var plot = new Plot({ -* 'description': 'A plot description.' -* }); -* var desc = plot.description; -* // returns 'A plot description.' -*/ -defineProperty( Plot.prototype, 'description', { - 'configurable': false, - 'enumerable': true, - 'set': setDescription, - 'get': getDescription -}); - -/** -* Plot title. -* -* @name title -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default '' -* -* @example -* var plot = new Plot(); -* plot.title = 'Time Series'; -* -* @example -* var plot = new Plot({ -* 'title': 'Time Series' -* }); -* var t = plot.title; -* // returns 'Time Series' -*/ -defineProperty( Plot.prototype, 'title', { - 'configurable': false, - 'enumerable': true, - 'set': setTitle, - 'get': getTitle -}); - -/** -* x-axis label. -* -* @name xLabel -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default 'x' -* -* @example -* var plot = new Plot(); -* plot.xLabel = 'time'; -* -* @example -* var plot = new Plot({ -* 'xLabel': 'time' -* }); -* var xLabel = plot.xLabel; -* // returns 'time' -*/ -defineProperty( Plot.prototype, 'xLabel', { - 'configurable': false, - 'enumerable': true, - 'set': setXLabel, - 'get': getXLabel -}); - -/** -* y-axis label. -* -* @name yLabel -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default 'y' -* -* @example -* var plot = new Plot(); -* plot.yLabel = 'value'; -* -* @example -* var plot = new Plot({ -* 'yLabel': 'value' -* }); -* var yLabel = plot.yLabel; -* // returns 'value' -*/ -defineProperty( Plot.prototype, 'yLabel', { - 'configurable': false, - 'enumerable': true, - 'set': setYLabel, - 'get': getYLabel -}); - -/** -* Plot engine. -* -* @name engine -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a recognized engine -* @default 'svg' -* -* @example -* var plot = new Plot(); -* plot.engine = 'svg'; -* -* @example -* var plot = new Plot({ -* 'engine': 'svg' -* }); -* var engine = plot.engine; -* // returns 'svg' -*/ -defineProperty( Plot.prototype, 'engine', { - 'configurable': false, - 'enumerable': true, - 'set': setEngine, - 'get': getEngine -}); - -/** -* Rendering mode. -* -* ## Notes -* -* - If `true`, an instance re-renders on each change event. -* -* @name autoRender -* @memberof Plot.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var plot = new Plot({ -* 'autoRender': true -* }); -* -* var mode = plot.autoRender; -* // returns true -*/ -defineProperty( Plot.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Plot render format. -* -* @name renderFormat -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a recognized format -* @default 'vdom' -* -* @example -* var plot = new Plot(); -* plot.renderFormat = 'vdom'; -* -* @example -* var plot = new Plot({ -* 'renderFormat': 'html' -* }); -* var fmt = plot.renderFormat; -* // returns 'html' -*/ -defineProperty( Plot.prototype, 'renderFormat', { - 'configurable': false, - 'enumerable': true, - 'set': setRenderFormat, - 'get': getRenderFormat -}); - -/** -* Plot viewer. -* -* @name viewer -* @memberof Plot.prototype -* @type {string} -* @throws {TypeError} must be a recognized viewer -* @default 'none' -* -* @example -* var plot = new Plot(); -* plot.viewer = 'none'; -* -* @example -* var plot = new Plot({ -* 'viewer': 'none' -* }); -* var viewer = plot.viewer; -* // returns 'none' -*/ -defineProperty( Plot.prototype, 'viewer', { - 'configurable': false, - 'enumerable': true, - 'set': setViewer, - 'get': getViewer -}); - -/** -* Viewer mode. If `true`, an instance generates an updated view on each render event. -* -* @name autoView -* @memberof Plot.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var plot = new Plot({ -* 'autoView': false -* }); -* -* var mode = plot.autoView; -* // returns false -*/ -defineProperty( Plot.prototype, 'autoView', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoView, - 'get': getAutoView -}); - -/** -* Expected graph width. -* -* @name graphWidth -* @memberof Plot.prototype -* @type {number} -* -* @example -* var plot = new Plot({ -* 'width': 100, -* 'paddingLeft': 10, -* 'paddingRight': 10 -* }); -* var width = plot.graphWidth; -* // returns 80 -*/ -defineProperty( Plot.prototype, 'graphWidth', { - 'configurable': false, - 'enumerable': true, - 'get': getGraphWidth -}); - -/** -* Expected graph height. -* -* @name graphHeight -* @memberof Plot.prototype -* @type {number} -* -* @example -* var plot = new Plot({ -* 'height': 100, -* 'paddingTop': 10, -* 'paddingBottom': 20 -* }); -* var height = plot.graphHeight; -* // returns 70 -*/ -defineProperty( Plot.prototype, 'graphHeight', { - 'configurable': false, - 'enumerable': true, - 'get': getGraphHeight -}); - -/** -* x-axis domain. -* -* @name xDomain -* @memberof Plot.prototype -* @type {Array} -* -* @example -* var plot = new Plot({ -* 'xMin': 0, -* 'xMax': 100 -* }); -* var domain = plot.xDomain; -* // returns [ 0, 100 ] -*/ -defineProperty( Plot.prototype, 'xDomain', { - 'configurable': false, - 'enumerable': true, - 'get': getXDomain -}); - -/** -* y-axis domain. -* -* @name yDomain -* @memberof Plot.prototype -* @type {NumberArray} -* -* @example -* var plot = new Plot({ -* 'yMin': 0, -* 'yMax': 100 -* }); -* var domain = plot.yDomain; -* // returns [ 0, 100 ] -*/ -defineProperty( Plot.prototype, 'yDomain', { - 'configurable': false, - 'enumerable': true, - 'get': getYDomain -}); - -/** -* x-axis range. -* -* @name xRange -* @memberof Plot.prototype -* @type {NumberArray} -* -* @example -* var plot = new Plot({ -* 'width': 100, -* 'paddingLeft': 10, -* 'paddingRight': 10 -* }); -* var range = plot.xRange; -* // returns [ 0, 80 ] -*/ -defineProperty( Plot.prototype, 'xRange', { - 'configurable': false, - 'enumerable': true, - 'get': getXRange -}); - -/** -* y-axis range. -* -* @name yRange -* @memberof Plot.prototype -* @type {NumberArray} -* -* @example -* var plot = new Plot({ -* 'height': 100, -* 'paddingTop': 10, -* 'paddingBottom': 20 -* }); -* var range = plot.yRange; -* // returns [ 70, 0 ] -*/ -defineProperty( Plot.prototype, 'yRange', { - 'configurable': false, - 'enumerable': true, - 'get': getYRange -}); - -/** -* Function to map values to x-axis coordinate values. -* -* @name xPos -* @memberof Plot.prototype -* @type {Function} -* -* @example -* var plot = new Plot(); -* var xPos = plot.xPos; -* // returns -*/ -defineProperty( Plot.prototype, 'xPos', { - 'configurable': false, - 'enumerable': true, - 'get': getXPos -}); - -/** -* Function to map values to y-axis coordinate values. -* -* @name yPos -* @memberof Plot.prototype -* @type {Function} -* -* @example -* var plot = new Plot(); -* var yPos = plot.yPos; -* // returns -*/ -defineProperty( Plot.prototype, 'yPos', { - 'configurable': false, - 'enumerable': true, - 'get': getYPos -}); - -/** -* Renders a plot. -* -* @name render -* @memberof Plot.prototype -* @type {Function} -* @param {string} [format] - render format -* @throws {TypeError} must provide a recognized format -* @returns {(VTree|string)} virtual tree or string -* -* @example -* var plot = new Plot(); -* plot.x = [ [ 1, 2, 3 ] ]; -* plot.y = [ [ 1, 0, 1 ] ]; -* -* var out = plot.render(); -* -* @example -* var plot = new Plot(); -* plot.x = [ [ 1, 2, 3 ] ]; -* plot.y = [ [ 1, 0, 1 ] ]; -* -* var out = plot.render( 'html' ); -*/ -setReadOnly( Plot.prototype, 'render', render ); - -/** -* Generates a plot view. -* -* @name view -* @memberof Plot.prototype -* @type {Function} -* @param {string} [viewer] -* @throws {TypeError} must provide a recognized viewer -* -* @example -* var plot = new Plot(); -* plot.x = [ [ 1, 2, 3 ] ]; -* plot.y = [ [ 1, 0, 1 ] ]; -* -* plot.view( 'stdout' ); -*/ -setReadOnly( Plot.prototype, 'view', viewMethod ); - - -// EXPORTS // - -module.exports = Plot; diff --git a/ctor/lib/props/auto-render/get.js b/ctor/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/ctor/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/auto-render/set.js b/ctor/lib/props/auto-render/set.js deleted file mode 100644 index d17bea6..0000000 --- a/ctor/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - if ( bool !== this._autoRender ) { - debug( 'Current value: %s.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %s.', this._autoRender ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/auto-view/get.js b/ctor/lib/props/auto-view/get.js deleted file mode 100644 index 5b414b9..0000000 --- a/ctor/lib/props/auto-view/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the viewing mode. -* -* @private -* @returns {boolean} viewing mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoView; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/auto-view/set.js b/ctor/lib/props/auto-view/set.js deleted file mode 100644 index 793b3e5..0000000 --- a/ctor/lib/props/auto-view/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:auto-view' ); - - -// MAIN // - -/** -* Sets the viewing mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to generate an updated view on a render event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoView', bool ) ); - } - if ( bool !== this._autoView ) { - debug( 'Current value: %s.', this._autoView ); - - this._autoView = bool; - debug( 'New Value: %s.', this._autoView ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/colors/colors.js b/ctor/lib/props/colors/colors.js deleted file mode 100644 index 9c82df4..0000000 --- a/ctor/lib/props/colors/colors.js +++ /dev/null @@ -1,112 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/* -* See [D3]{@link https://github.com/d3/d3-scale/blob/master/README.md}. -*/ - -var COLORS = {}; - -COLORS.category10 = [ - '#1f77b4', // 'category10-1' - '#ff7f0e', // 'category10-2' - '#2ca02c', // 'category10-3' - '#d62728', // 'category10-4' - '#9467bd', // 'category10-5' - '#8c564b', // 'category10-6' - '#e377c2', // 'category10-7' - '#7f7f7f', // 'category10-8' - '#bcdb22', // 'category10-9' - '#17becf' // 'category10-10' -]; - -COLORS.category20 = [ - '#1f77b4', // 'category20-1' - '#aec7e8', // 'category20-2' - '#ff7f0e', // 'category20-3' - '#ffbb78', // 'category20-4' - '#2ca02c', // 'category20-5' - '#98df8a', // 'category20-6' - '#d62728', // 'category20-7' - '#ff9896', // 'category20-8' - '#9467bd', // 'category20-9' - '#c5b0d5', // 'category20-10' - '#8c564b', // 'category20-11' - '#c49c94', // 'category20-12' - '#e377c2', // 'category20-13' - '#f7b6d2', // 'category20-14' - '#7f7f7f', // 'category20-15' - '#c7c7c7', // 'category20-16' - '#bcbd22', // 'category20-17' - '#dbdb8d', // 'category20-18' - '#17becf', // 'category20-19' - '#9edae5' // 'category20-20' -]; - -COLORS.category20b = [ - '#393b79', // 'category20b-1' - '#5254a3', // 'category20b-2' - '#6b6ecf', // 'category20b-3' - '#9c9ede', // 'category20b-4' - '#637939', // 'category20b-5' - '#8ca252', // 'category20b-6' - '#b5cf6b', // 'category20b-7' - '#cedb9c', // 'category20b-8' - '#8c6d31', // 'category20b-9' - '#bd9e39', // 'category20b-10' - '#e7ba52', // 'category20b-11' - '#e7cb94', // 'category20b-12' - '#843c39', // 'category20b-13' - '#ad494a', // 'category20b-14' - '#d6616b', // 'category20b-15' - '#e7969c', // 'category20b-16' - '#7b4173', // 'category20b-17' - '#a55194', // 'category20b-18' - '#ce6dbd', // 'category20b-19' - '#de9ed6' // 'category20b-20' -]; - -COLORS.category20c = [ - '#3182bd', // 'category20c-1' - '#6baed6', // 'category20c-2' - '#9ecae1', // 'category20c-3' - '#c6dbef', // 'category20c-4' - '#e6550d', // 'category20c-5' - '#fd8d3c', // 'category20c-6' - '#fdae6b', // 'category20c-7' - '#fdd0a2', // 'category20c-8' - '#31a354', // 'category20c-9' - '#74c476', // 'category20c-10' - '#a1d99b', // 'category20c-11' - '#c7e9c0', // 'category20c-12' - '#756bb1', // 'category20c-13' - '#9e9ac8', // 'category20c-14' - '#bcbddc', // 'category20c-15' - '#dadaeb', // 'category20c-16' - '#636363', // 'category20c-17' - '#969696', // 'category20c-18' - '#bdbdbd', // 'category20c-19' - '#d9d9d9' // 'category20c-20' -]; - - -// EXPORTS // - -module.exports = COLORS; diff --git a/ctor/lib/props/colors/get.js b/ctor/lib/props/colors/get.js deleted file mode 100644 index 4518d7d..0000000 --- a/ctor/lib/props/colors/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data colors. -* -* @private -* @returns {StringArray} colors -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._colors.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/colors/set.js b/ctor/lib/props/colors/set.js deleted file mode 100644 index cad3be7..0000000 --- a/ctor/lib/props/colors/set.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var format = require( '@stdlib/string/format' ); -var COLORS = require( './colors.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:colors' ); - - -// MAIN // - -/** -* Sets the data colors. -* -* @private -* @param {(string|StringArray)} v - data colors -* @throws {TypeError} must be either a string or an array of strings -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isStr = isString( v ); - if ( !isStr && !isStringArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'colors', v ) ); - } - if ( isStr ) { - if ( COLORS[ v ] === void 0 ) { - v = [ v ]; - } else { - v = COLORS[ v ].slice(); - } - } else { - v = v.slice(); - } - debug( 'Current value: %s.', JSON.stringify( this._colors ) ); - - this._colors = v; - debug( 'New Value: %s.', JSON.stringify( this._colors ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/description/get.js b/ctor/lib/props/description/get.js deleted file mode 100644 index d67c978..0000000 --- a/ctor/lib/props/description/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the description. -* -* @private -* @returns {string} description -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._description; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/description/set.js b/ctor/lib/props/description/set.js deleted file mode 100644 index b8a58ad..0000000 --- a/ctor/lib/props/description/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:description' ); - - -// MAIN // - -/** -* Sets the description. -* -* @private -* @param {string} str - description -* @throws {TypeError} must be a string -*/ -function set( str ) { - /* eslint-disable no-invalid-this */ - if ( !isString( str ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'description', str ) ); - } - if ( str !== this._description ) { - debug( 'Current value: %s.', this._description ); - - this._description = str; - debug( 'New value: %s.', this._description ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/engine/engines.json b/ctor/lib/props/engine/engines.json deleted file mode 100644 index 00a90eb..0000000 --- a/ctor/lib/props/engine/engines.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "svg" -] diff --git a/ctor/lib/props/engine/get.js b/ctor/lib/props/engine/get.js deleted file mode 100644 index 5ec3e30..0000000 --- a/ctor/lib/props/engine/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the plot engine. -* -* @private -* @returns {string} engine -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._engine; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/engine/set.js b/ctor/lib/props/engine/set.js deleted file mode 100644 index 2d38442..0000000 --- a/ctor/lib/props/engine/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var contains = require( '@stdlib/assert/contains' ); -var format = require( '@stdlib/string/format' ); -var ENGINES = require( './engines.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:engine' ); - - -// MAIN // - -/** -* Sets the engine. -* -* @private -* @param {string} engine - engine -* @throws {TypeError} must be a recognized engine -*/ -function set( engine ) { - /* eslint-disable no-invalid-this */ - if ( !contains( ENGINES, engine ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'engine', ENGINES.join( '", "' ), engine ) ); - } - if ( engine !== this._engine ) { - debug( 'Current value: %s.', this._engine ); - - this._engine = engine; - debug( 'New value: %s.', this._engine ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/graph-height/get.js b/ctor/lib/props/graph-height/get.js deleted file mode 100644 index a3da4e0..0000000 --- a/ctor/lib/props/graph-height/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the expected graph height. -* -* @private -* @returns {number} graph height -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._height - this._paddingTop - this._paddingBottom; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/graph-width/get.js b/ctor/lib/props/graph-width/get.js deleted file mode 100644 index 21a60f9..0000000 --- a/ctor/lib/props/graph-width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the expected graph width. -* -* @private -* @returns {number} graph width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width - this._paddingLeft - this._paddingRight; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/height/get.js b/ctor/lib/props/height/get.js deleted file mode 100644 index 64bcb89..0000000 --- a/ctor/lib/props/height/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the height. -* -* @private -* @returns {number} height -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._height; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/height/set.js b/ctor/lib/props/height/set.js deleted file mode 100644 index 18cd62a..0000000 --- a/ctor/lib/props/height/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:height' ); - - -// MAIN // - -/** -* Sets the height. -* -* @private -* @param {PositiveNumber} height - height -* @throws {TypeError} must be a positive number -* @returns {void} -*/ -function set( height ) { - /* eslint-disable no-invalid-this */ - if ( !isPositiveNumber( height ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', height ) ); - } - if ( height !== this._height ) { - debug( 'Current value: %d.', this._height ); - - this._height = height; - debug( 'New Value: %d.', this._height ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/is-defined/get.js b/ctor/lib/props/is-defined/get.js deleted file mode 100644 index fd05f22..0000000 --- a/ctor/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the accessor for defined values. -* -* @private -* @returns {Function} accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/is-defined/set.js b/ctor/lib/props/is-defined/set.js deleted file mode 100644 index 7e8dbe2..0000000 --- a/ctor/lib/props/is-defined/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:is-defined' ); - - -// MAIN // - -/** -* Sets the accessor for defined values. -* -* @private -* @param {Function} fcn - accessor -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - if ( fcn !== this._isDefined ) { - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/labels/get.js b/ctor/lib/props/labels/get.js deleted file mode 100644 index 8188d4f..0000000 --- a/ctor/lib/props/labels/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data labels. -* -* @private -* @returns {(EmptyArray|StringArray)} labels -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._labels.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/labels/set.js b/ctor/lib/props/labels/set.js deleted file mode 100644 index 599d292..0000000 --- a/ctor/lib/props/labels/set.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isEmptyArray = require( '@stdlib/assert/is-empty-array' ); -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:labels' ); - - -// MAIN // - -/** -* Sets the data labels. -* -* @private -* @param {(StringArray|EmptyArray)} labels - data labels -* @throws {TypeError} must be either an array of strings or an empty array -* @returns {void} -*/ -function set( labels ) { - /* eslint-disable no-invalid-this */ - if ( - !isEmptyArray( labels ) && - !isStringArray( labels ) - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be an array of strings or an empty array. Value: `%s`.', 'labels', labels ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._labels ) ); - - this._labels = labels.slice(); - debug( 'New Value: %s.', JSON.stringify( this._labels ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/line-opacity/get.js b/ctor/lib/props/line-opacity/get.js deleted file mode 100644 index b139b94..0000000 --- a/ctor/lib/props/line-opacity/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data line opacity. -* -* @private -* @returns {NumberArray} line opacity -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._lineOpacity.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/line-opacity/set.js b/ctor/lib/props/line-opacity/set.js deleted file mode 100644 index 2cd5e47..0000000 --- a/ctor/lib/props/line-opacity/set.js +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isNumberArray = require( '@stdlib/assert/is-number-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:line-opacity' ); - - -// MAIN // - -/** -* Sets the data line opacity. -* -* @private -* @param {(number|NumberArray)} v - opacity -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( v ); - var i; - if ( !isNum && !isNumberArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'lineOpacity', v ) ); - } - if ( isNum ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( v[ i ] < 0.0 || v[ i ] > 1.0 ) { - throw new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'lineOpacity', v[i] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._lineOpacity ) ); - - this._lineOpacity = v; - debug( 'New Value: %s.', JSON.stringify( this._lineOpacity ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/line-style/get.js b/ctor/lib/props/line-style/get.js deleted file mode 100644 index 0a8694b..0000000 --- a/ctor/lib/props/line-style/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data line style(s). -* -* @private -* @returns {StringArray} line style(s) -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._lineStyle.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/line-style/line_styles.json b/ctor/lib/props/line-style/line_styles.json deleted file mode 100644 index 94d97ef..0000000 --- a/ctor/lib/props/line-style/line_styles.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "-", - "--", - ":", - "-.", - "none" -] diff --git a/ctor/lib/props/line-style/set.js b/ctor/lib/props/line-style/set.js deleted file mode 100644 index 50600fa..0000000 --- a/ctor/lib/props/line-style/set.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var LINESTYLES = require( './line_styles.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:line-style' ); - - -// MAIN // - -/** -* Sets the data line style(s). -* -* @private -* @param {(string|StringArray)} v - line style(s) -* @throws {TypeError} must be a string or string array -* @throws {Error} must be a supported line style -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isStr = isString( v ); - var i; - if ( !isStr && !isStringArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'lineStyle', v ) ); - } - if ( isStr ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( indexOf( LINESTYLES, v[i] ) === -1 ) { - throw new Error( format( 'invalid assignment. Unsupported/unrecognized line style. Must be one of the following: "%s". Value: `%s`.', LINESTYLES.join( '", "' ), v[i] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._lineStyle ) ); - - this._lineStyle = v; - debug( 'New Value: %s.', JSON.stringify( this._lineStyle ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/line-width/get.js b/ctor/lib/props/line-width/get.js deleted file mode 100644 index 90ad210..0000000 --- a/ctor/lib/props/line-width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data line width. -* -* @private -* @returns {Array} line width(s) -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._lineWidth.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/line-width/set.js b/ctor/lib/props/line-width/set.js deleted file mode 100644 index 1592dc9..0000000 --- a/ctor/lib/props/line-width/set.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:line-width' ); - - -// MAIN // - -/** -* Sets the data line width(s). -* -* @private -* @param {(NonNegativeInteger|Array)} v - width -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isInt = isNonNegativeInteger( v ); - if ( !isInt && !isNonNegativeIntegerArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'lineWidth', v ) ); - } - if ( isInt ) { - v = [ v ]; - } else { - v = v.slice(); - } - debug( 'Current value: %s.', JSON.stringify( this._lineWidth ) ); - - this._lineWidth = v; - debug( 'New Value: %s.', JSON.stringify( this._lineWidth ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/padding-bottom/get.js b/ctor/lib/props/padding-bottom/get.js deleted file mode 100644 index af214a0..0000000 --- a/ctor/lib/props/padding-bottom/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the bottom padding. -* -* @private -* @returns {number} padding -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._paddingBottom; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/padding-bottom/set.js b/ctor/lib/props/padding-bottom/set.js deleted file mode 100644 index a0b2c3c..0000000 --- a/ctor/lib/props/padding-bottom/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:padding-bottom' ); - - -// MAIN // - -/** -* Sets the bottom padding. -* -* @private -* @param {NonNegativeInteger} padding - padding -* @throws {TypeError} must be a nonnegative integer -*/ -function set( padding ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( padding ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingBottom', padding ) ); - } - if ( padding !== this._paddingBottom ) { - debug( 'Current value: %d.', this._paddingBottom ); - - this._paddingBottom = padding; - debug( 'New value: %d.', this._paddingBottom ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/padding-left/get.js b/ctor/lib/props/padding-left/get.js deleted file mode 100644 index 162c41b..0000000 --- a/ctor/lib/props/padding-left/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the left padding. -* -* @private -* @returns {number} padding -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._paddingLeft; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/padding-left/set.js b/ctor/lib/props/padding-left/set.js deleted file mode 100644 index b50c85a..0000000 --- a/ctor/lib/props/padding-left/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:padding-left' ); - - -// MAIN // - -/** -* Sets the left padding. -* -* @private -* @param {NonNegativeInteger} padding - padding -* @throws {TypeError} must be a nonnegative integer -*/ -function set( padding ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( padding ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingLeft', padding ) ); - } - if ( padding !== this._paddingLeft ) { - debug( 'Current value: %d.', this._paddingLeft ); - - this._paddingLeft = padding; - debug( 'New value: %d.', this._paddingLeft ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/padding-right/get.js b/ctor/lib/props/padding-right/get.js deleted file mode 100644 index 3da30d1..0000000 --- a/ctor/lib/props/padding-right/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the right padding. -* -* @private -* @returns {number} padding -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._paddingRight; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/padding-right/set.js b/ctor/lib/props/padding-right/set.js deleted file mode 100644 index e039b98..0000000 --- a/ctor/lib/props/padding-right/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:padding-right' ); - - -// MAIN // - -/** -* Sets the right padding. -* -* @private -* @param {NonNegativeInteger} padding - padding -* @throws {TypeError} must be a nonnegative integer -*/ -function set( padding ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( padding ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingRight', padding ) ); - } - if ( padding !== this._paddingRight ) { - debug( 'Current value: %d.', this._paddingRight ); - - this._paddingRight = padding; - debug( 'New value: %d.', this._paddingRight ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/padding-top/get.js b/ctor/lib/props/padding-top/get.js deleted file mode 100644 index 4afa617..0000000 --- a/ctor/lib/props/padding-top/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the top padding. -* -* @private -* @returns {number} padding -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._paddingTop; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/padding-top/set.js b/ctor/lib/props/padding-top/set.js deleted file mode 100644 index 02b814d..0000000 --- a/ctor/lib/props/padding-top/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:padding-top' ); - - -// MAIN // - -/** -* Sets the top padding. -* -* @private -* @param {NonNegativeInteger} padding - padding -* @throws {TypeError} must be a nonnegative integer -*/ -function set( padding ) { - /* eslint-disable no-invalid-this */ - if ( !isNonNegativeInteger( padding ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingTop', padding ) ); - } - if ( padding !== this._paddingTop ) { - debug( 'Current value: %d.', this._paddingTop ); - - this._paddingTop = padding; - debug( 'New value: %d.', this._paddingTop ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/render-format/formats.json b/ctor/lib/props/render-format/formats.json deleted file mode 100644 index 7479e77..0000000 --- a/ctor/lib/props/render-format/formats.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "vdom", - "html" -] diff --git a/ctor/lib/props/render-format/get.js b/ctor/lib/props/render-format/get.js deleted file mode 100644 index 8b42464..0000000 --- a/ctor/lib/props/render-format/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the render format. -* -* @private -* @returns {string} format -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._renderFormat; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/render-format/set.js b/ctor/lib/props/render-format/set.js deleted file mode 100644 index 59a7812..0000000 --- a/ctor/lib/props/render-format/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var FORMATS = require( './formats.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:renderformat' ); - - -// MAIN // - -/** -* Sets the render format. -* -* @private -* @param {string} fmt - format -* @throws {TypeError} must be a recognized render format -*/ -function set( fmt ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( FORMATS, fmt ) === -1 ) { - throw new TypeError( format( 'invalid assignment. Unrecognized/unsupported `%s`. Must be one of the following: "%s". Value: `%s`.', 'format', FORMATS.join( '", "' ), fmt ) ); - } - if ( fmt !== this._renderFormat ) { - debug( 'Current value: %s.', this._renderFormat ); - - this._renderFormat = fmt; - debug( 'New value: %s.', this._renderFormat ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/symbols-opacity/get.js b/ctor/lib/props/symbols-opacity/get.js deleted file mode 100644 index 64c0286..0000000 --- a/ctor/lib/props/symbols-opacity/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the symbols opacity. -* -* @private -* @returns {NumberArray} symbols opacity -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._symbolsOpacity.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/symbols-opacity/set.js b/ctor/lib/props/symbols-opacity/set.js deleted file mode 100644 index 0741f26..0000000 --- a/ctor/lib/props/symbols-opacity/set.js +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isNumberArray = require( '@stdlib/assert/is-number-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:symbols-opacity' ); - - -// MAIN // - -/** -* Sets the symbol opacity. -* -* @private -* @param {(number|NumberArray)} v - opacity -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( v ); - var i; - if ( !isNum && !isNumberArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'symbolsOpacity', v ) ); - } - if ( isNum ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( v[ i ] < 0.0 || v[ i ] > 1.0 ) { - throw new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'symbolsOpacity', v[ i ] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._symbolsOpacity ) ); - - this._symbolsOpacity = v; - debug( 'New Value: %s.', JSON.stringify( this._symbolsOpacity ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/symbols-size/get.js b/ctor/lib/props/symbols-size/get.js deleted file mode 100644 index dbf9c07..0000000 --- a/ctor/lib/props/symbols-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the symbols size. -* -* @private -* @returns {Array} symbols sizes -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._symbolsSize.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/symbols-size/set.js b/ctor/lib/props/symbols-size/set.js deleted file mode 100644 index b007fc7..0000000 --- a/ctor/lib/props/symbols-size/set.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:symbols-size' ); - - -// MAIN // - -/** -* Sets the symbols size. -* -* @private -* @param {(NonNegativeInteger|Array)} v - size -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isInt = isNonNegativeInteger( v ); - if ( !isInt && !isNonNegativeIntegerArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'symbolsSize', v ) ); - } - if ( isInt ) { - v = [ v ]; - } else { - v = v.slice(); - } - debug( 'Current value: %s.', JSON.stringify( this._symbolsSize ) ); - - this._symbolsSize = v; - debug( 'New Value: %s.', JSON.stringify( this._symbolsSize ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/symbols/get.js b/ctor/lib/props/symbols/get.js deleted file mode 100644 index aeb6e7b..0000000 --- a/ctor/lib/props/symbols/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data symbols. -* -* @private -* @returns {StringArray} symbols -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._symbols.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/symbols/set.js b/ctor/lib/props/symbols/set.js deleted file mode 100644 index c52b034..0000000 --- a/ctor/lib/props/symbols/set.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var SYMBOLS = require( './symbols.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:symbols' ); - - -// MAIN // - -/** -* Sets the data symbols. -* -* @private -* @param {(string|StringArray)} v - data symbols -* @throws {TypeError} must be a string or string array -* @throws {Error} must be a supported symbol -* @returns {void} -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isStr = isString( v ); - var i; - if ( !isStr && !isStringArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'symbols', v ) ); - } - if ( isStr ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( indexOf( SYMBOLS, v[i] ) === -1 ) { - throw new Error( format( 'invalid assignment. Unrecognized/unsupported symbol. Value: `[%s]`.', v.join(',') ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._symbols ) ); - - this._symbols = v; - debug( 'New Value: %s.', JSON.stringify( this._symbols ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/symbols/symbols.json b/ctor/lib/props/symbols/symbols.json deleted file mode 100644 index c0a5bab..0000000 --- a/ctor/lib/props/symbols/symbols.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "closed-circle", - "open-circle", - "none" -] diff --git a/ctor/lib/props/title/get.js b/ctor/lib/props/title/get.js deleted file mode 100644 index 9417faa..0000000 --- a/ctor/lib/props/title/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the title. -* -* @private -* @returns {string} title -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._title; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/title/set.js b/ctor/lib/props/title/set.js deleted file mode 100644 index 4ea376a..0000000 --- a/ctor/lib/props/title/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:title' ); - - -// MAIN // - -/** -* Sets the title. -* -* @private -* @param {string} str - title -* @throws {TypeError} must be a string -*/ -function set( str ) { - /* eslint-disable no-invalid-this */ - if ( !isString( str ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'title', str ) ); - } - if ( str !== this._title ) { - debug( 'Current value: %s.', this._title ); - - this._title = str; - debug( 'New value: %s.', this._title ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/viewer/get.js b/ctor/lib/props/viewer/get.js deleted file mode 100644 index a8044ca..0000000 --- a/ctor/lib/props/viewer/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the plot viewer. -* -* @private -* @returns {string} viewer -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._viewer; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/viewer/set.js b/ctor/lib/props/viewer/set.js deleted file mode 100644 index ac13e79..0000000 --- a/ctor/lib/props/viewer/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var VIEWERS = require( './viewers.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:viewer' ); - - -// MAIN // - -/** -* Sets the viewer. -* -* @private -* @param {string} viewer - viewer -* @throws {TypeError} must be a recognized viewer -*/ -function set( viewer ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( VIEWERS, viewer ) === -1 ) { - throw new TypeError( format( 'invalid assignment. Unrecognized/unsupported `%s`. Value: `%s`.', 'viewer', viewer ) ); - } - if ( viewer !== this._viewer ) { - debug( 'Current value: %s.', this._viewer ); - - this._viewer = viewer; - debug( 'New value: %s.', this._viewer ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/viewer/viewers.json b/ctor/lib/props/viewer/viewers.json deleted file mode 100644 index f515292..0000000 --- a/ctor/lib/props/viewer/viewers.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "none", - "browser", - "terminal", - "stdout", - "window" -] diff --git a/ctor/lib/props/width/get.js b/ctor/lib/props/width/get.js deleted file mode 100644 index cfa5f0e..0000000 --- a/ctor/lib/props/width/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the width. -* -* @private -* @returns {number} width -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._width; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/width/set.js b/ctor/lib/props/width/set.js deleted file mode 100644 index b118a3a..0000000 --- a/ctor/lib/props/width/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:width' ); - - -// MAIN // - -/** -* Sets the width. -* -* @private -* @param {PositiveNumber} width - width -* @throws {TypeError} must be a positive number -*/ -function set( width ) { - /* eslint-disable no-invalid-this */ - if ( !isPositiveNumber( width ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', width ) ); - } - if ( width !== this._width ) { - debug( 'Current value: %d.', this._width ); - - this._width = width; - debug( 'New value: %d.', this._width ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-axis-orient/get.js b/ctor/lib/props/x-axis-orient/get.js deleted file mode 100644 index a96e518..0000000 --- a/ctor/lib/props/x-axis-orient/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis orientation. -* -* @private -* @returns {string} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xAxisOrient; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-axis-orient/orientations.json b/ctor/lib/props/x-axis-orient/orientations.json deleted file mode 100644 index 1e375c3..0000000 --- a/ctor/lib/props/x-axis-orient/orientations.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "bottom", - "top" -] diff --git a/ctor/lib/props/x-axis-orient/set.js b/ctor/lib/props/x-axis-orient/set.js deleted file mode 100644 index 5071313..0000000 --- a/ctor/lib/props/x-axis-orient/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './orientations.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-axis-orient' ); - - -// MAIN // - -/** -* Sets the x-axis orientation. -* -* @private -* @param {string} orientation - axis orientation -* @throws {TypeError} must be either `'bottom'` or `'top'` -*/ -function set( orientation ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( ORIENTATIONS, orientation ) === -1 ) { - throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'xAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) ); - } - if ( orientation !== this._xAxisOrient ) { - debug( 'Current value: %s.', this._xAxisOrient ); - - this._xAxisOrient = orientation; - debug( 'New value: %s.', this._xAxisOrient ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-domain/get.js b/ctor/lib/props/x-domain/get.js deleted file mode 100644 index 44e571f..0000000 --- a/ctor/lib/props/x-domain/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis domain. -* -* @private -* @returns {Array} domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - return [ this.xMin, this.xMax ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-label/get.js b/ctor/lib/props/x-label/get.js deleted file mode 100644 index eeec342..0000000 --- a/ctor/lib/props/x-label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xLabel; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-label/set.js b/ctor/lib/props/x-label/set.js deleted file mode 100644 index efdb661..0000000 --- a/ctor/lib/props/x-label/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-label' ); - - -// MAIN // - -/** -* Sets the x-axis label. -* -* @private -* @param {string} label - axis label -* @throws {TypeError} must be a string -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'xLabel', label ) ); - } - if ( label !== this._xLabel ) { - debug( 'Current value: %s.', this._xLabel ); - - this._xLabel = label; - debug( 'New value: %s.', this._xLabel ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-max/get.js b/ctor/lib/props/x-max/get.js deleted file mode 100644 index dddec8d..0000000 --- a/ctor/lib/props/x-max/get.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var max = require( './../../utils/max.js' ); // TODO: replace with stdlib package import when added - - -// FUNCTIONS // - -/** -* Computes a maximum value. -* -* @private -* @param {Array} arr - input array -* @returns {(number|null)} maximum value or null -*/ -function getMax( arr ) { - var tmp; - var i; - if ( arr.length === 0 ) { - return null; - } - tmp = []; - for ( i = 0; i < arr.length; i++ ) { - tmp.push( max( arr[ i ] ) ); - } - return max( tmp ); -} - - -// MAIN // - -/** -* Returns the maximum value of the x-axis domain. -* -* @private -* @returns {number} maximum value -*/ -function get() { - /* eslint-disable no-invalid-this */ - var max; - if ( isNull( this._xMax ) ) { - max = getMax( this._xData ); - return ( isNull( max ) ) ? 1.0 : max; - } - return this._xMax; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-max/set.js b/ctor/lib/props/x-max/set.js deleted file mode 100644 index fc9ae9c..0000000 --- a/ctor/lib/props/x-max/set.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'line:set:x-max' ); - - -// MAIN // - -/** -* Sets the maximum value of the x-axis domain. -* -* @private -* @param {(Date|FiniteNumber|null)} max - maximum value -* @throws {TypeError} must be a finite number primitive or null -*/ -function set( max ) { - /* eslint-disable no-invalid-this */ - - // TODO: add test to determine if evaluates to valid date? - if ( - !isNull( max ) && - !isNumber( max ) // FIXME: finite number - - // TODO: Date - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number, Date, or null. Value: `%s`.', 'xMax', max ) ); - } - if ( max !== this._xMax ) { - debug( 'Current value: %s.', this._xMax ); - - this._xMax = max; - debug( 'New value: %s.', this._xMax ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-min/get.js b/ctor/lib/props/x-min/get.js deleted file mode 100644 index 6c708f3..0000000 --- a/ctor/lib/props/x-min/get.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var min = require( './../../utils/min.js' ); // TODO: replace with mod when written - - -// FUNCTIONS // - -/** -* Computes a minimum value. -* -* @private -* @param {Array} arr - input array -* @returns {(number|null)} minimum value or null -*/ -function getMin( arr ) { - var tmp; - var i; - if ( arr.length === 0 ) { - return null; - } - tmp = new Array( arr.length ); - for ( i = 0; i < arr.length; i++ ) { - tmp[ i ] = min( arr[ i ] ); - } - return min( tmp ); -} - - -// MAIN // - -/** -* Returns the minimum value of the x-axis domain. -* -* @private -* @returns {number} minimum value -*/ -function get() { - /* eslint-disable no-invalid-this */ - var min; - if ( isNull( this._xMin ) ) { - min = getMin( this._xData ); - return ( isNull( min ) ) ? 0.0 : min; - } - return this._xMin; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-min/set.js b/ctor/lib/props/x-min/set.js deleted file mode 100644 index 6a097f0..0000000 --- a/ctor/lib/props/x-min/set.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-min' ); - - -// MAIN // - -/** -* Sets the minimum value of the x-axis domain. -* -* @private -* @param {(Date|FiniteNumber|null)} min - minimum value -* @throws {TypeError} must be a finite number or null -* @returns {void} -*/ -function set( min ) { - /* eslint-disable no-invalid-this */ - - // TODO: add test to determine if evaluates to valid date? - if ( - !isNull( min ) && - !isNumber( min ) // FIXME: finite number - - // TODO: Date - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number, Date, or null. Value: `%s`.', 'xMin', min ) ); - } - debug( 'Current value: %s.', this._xMin ); - - this._xMin = min; - debug( 'New value: %s.', this._xMin ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-num-ticks/get.js b/ctor/lib/props/x-num-ticks/get.js deleted file mode 100644 index 02dc4ef..0000000 --- a/ctor/lib/props/x-num-ticks/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the number of x-axis tick marks. -* -* @private -* @returns {(NonNegativeInteger|null)} number of ticks -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xNumTicks; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-num-ticks/set.js b/ctor/lib/props/x-num-ticks/set.js deleted file mode 100644 index 2633357..0000000 --- a/ctor/lib/props/x-num-ticks/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-num-ticks' ); - - -// MAIN // - -/** -* Sets the number of x-axis tick marks. -* -* @private -* @param {(NonNegativeInteger|null)} ticks - number of ticks -* @throws {TypeError} must be a nonnegative integer or null -*/ -function set( ticks ) { - /* eslint-disable no-invalid-this */ - if ( !isNull( ticks ) && !isNonNegativeInteger( ticks ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'xNumTicks', ticks ) ); - } - if ( ticks !== this._xNumTicks ) { - debug( 'Current value: %d.', this._xNumTicks ); - - this._xNumTicks = ticks; - debug( 'New value: %d.', this._xNumTicks ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-pos/get.js b/ctor/lib/props/x-pos/get.js deleted file mode 100644 index 2cfa1f2..0000000 --- a/ctor/lib/props/x-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'plot:x-pos' ); - - -// MAIN // - -/** -* Returns a function to map values to x-axis coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.xScale; - return xPos; - - /** - * Maps a value to a x-axis coordinate value. - * - * @private - * @param {number} d - datum - * @returns {number} pixel value - */ - function xPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-range/get.js b/ctor/lib/props/x-range/get.js deleted file mode 100644 index 15069e3..0000000 --- a/ctor/lib/props/x-range/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis range. -* -* @private -* @returns {NumberArray} range -*/ -function get() { - /* eslint-disable no-invalid-this */ - return [ 0, this.graphWidth ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-rug-opacity/get.js b/ctor/lib/props/x-rug-opacity/get.js deleted file mode 100644 index 542b796..0000000 --- a/ctor/lib/props/x-rug-opacity/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis rug opacity. -* -* @private -* @returns {NumberArray} rug opacities -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xRugOpacity.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-rug-opacity/set.js b/ctor/lib/props/x-rug-opacity/set.js deleted file mode 100644 index f2eec76..0000000 --- a/ctor/lib/props/x-rug-opacity/set.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isNumberArray = require( '@stdlib/assert/is-number-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-rug-opacity' ); - - -// MAIN // - -/** -* Sets the x-axis rug opacity. -* -* @private -* @param {(number|NumberArray)} v - opacity -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( v ); - var i; - if ( !isNum && !isNumberArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'xRugOpacity', v ) ); - } - if ( isNum ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( v[ i ] < 0.0 || v[ i ] > 1.0 ) { - throw new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'xRugOpacity', v[i] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._xRugOpacity ) ); - - this._xRugOpacity = v; - debug( 'New Value: %s.', JSON.stringify( this._xRugOpacity ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-rug-orient/get.js b/ctor/lib/props/x-rug-orient/get.js deleted file mode 100644 index d388eb0..0000000 --- a/ctor/lib/props/x-rug-orient/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis rug orientation. -* -* @private -* @returns {StringArray} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xRugOrient.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-rug-orient/orientations.json b/ctor/lib/props/x-rug-orient/orientations.json deleted file mode 100644 index 1e375c3..0000000 --- a/ctor/lib/props/x-rug-orient/orientations.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "bottom", - "top" -] diff --git a/ctor/lib/props/x-rug-orient/set.js b/ctor/lib/props/x-rug-orient/set.js deleted file mode 100644 index eaeb2a2..0000000 --- a/ctor/lib/props/x-rug-orient/set.js +++ /dev/null @@ -1,74 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './orientations.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-rug-orient' ); - - -// MAIN // - -/** -* Sets the x-axis rug orientation. -* -* @private -* @param {(string|StringArray)} v - rug orientation -* @throws {TypeError} must be either a string or string array -* @throws {TypeError} must be either `'bottom'` or `'top'` -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isStr = isString( v ); - var i; - if ( !isStr && !isStringArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'xRugOrient', v ) ); - } - if ( isStr ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( indexOf( ORIENTATIONS, v[i] ) === -1 ) { - throw new TypeError( format( 'invalid assignment. Unrecognized/unsupported orientation. A `%s` value must be one of the following: "%s". Value: `%s`.', 'xRugOrient', ORIENTATIONS.join( '", "' ), v[ i ] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._xRugOrient ) ); - - this._xRugOrient = v; - debug( 'New value: %s.', JSON.stringify( this._xRugOrient ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-rug-size/get.js b/ctor/lib/props/x-rug-size/get.js deleted file mode 100644 index 7e1725e..0000000 --- a/ctor/lib/props/x-rug-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-axis rug tick (tassel) size. -* -* @private -* @returns {Array} tick sizes -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xRugSize.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-rug-size/set.js b/ctor/lib/props/x-rug-size/set.js deleted file mode 100644 index 0a3825a..0000000 --- a/ctor/lib/props/x-rug-size/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-rug-size' ); - - -// MAIN // - -/** -* Sets the x-axis rug tick (tassel) size. -* -* @private -* @param {(NonNegativeInteger|Array)} v - size -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isInt = isNonNegativeInteger( v ); - if ( !isInt && !isNonNegativeIntegerArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'xRugSize', v ) ); - } - if ( isInt ) { - v = [ v ]; - } else { - v = v.slice(); - } - debug( 'Current value: %s.', JSON.stringify( this._xRugSize ) ); - - this._xRugSize = v; - debug( 'New Value: %s.', JSON.stringify( this._xRugSize ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-rug/get.js b/ctor/lib/props/x-rug/get.js deleted file mode 100644 index 1cc37b7..0000000 --- a/ctor/lib/props/x-rug/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns whether a rug plot is displayed along the x-axis. -* -* @private -* @returns {BooleanArray} boolean flags -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xRug.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-rug/set.js b/ctor/lib/props/x-rug/set.js deleted file mode 100644 index 576015d..0000000 --- a/ctor/lib/props/x-rug/set.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var isBooleanArray = require( '@stdlib/assert/is-boolean-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-rug' ); - - -// MAIN // - -/** -* Sets a flag indicating whether to display a rug plot along the x-axis. -* -* @private -* @param {(boolean|BooleanArray)} v - boolean flag(s) indicating whether to display a rug plot along the x-axis -* @throws {TypeError} must be a boolean or boolean array -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isBool = isBoolean( v ); - if ( !isBool && !isBooleanArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean or an array of booleans. Value: `%s`.', 'xRug', v ) ); - } - if ( isBool ) { - v = [ v ]; - } - debug( 'Current value: %s.', JSON.stringify( this._xRug ) ); - - this._xRug = v; - debug( 'New Value: %s.', JSON.stringify( this._xRug ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-scale/get.js b/ctor/lib/props/x-scale/get.js deleted file mode 100644 index 7da4793..0000000 --- a/ctor/lib/props/x-scale/get.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var time = require( 'd3-scale' ).scaleTime; // TODO: remove - - -// MAIN // - -/** -* Returns a scale function for mapping values to a coordinate along the x-axis. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale; - if ( this._xScale === 'time' ) { - scale = time() - .domain( this.xDomain ) - .range( this.xRange ); - } else if ( this._xScale === 'linear' ) { - scale = linear() - .domain( this.xDomain ) - .range( this.xRange ); - } - // TODO: other scales - return scale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-scale/set.js b/ctor/lib/props/x-scale/set.js deleted file mode 100644 index 9f2c000..0000000 --- a/ctor/lib/props/x-scale/set.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-scale' ); - - -// MAIN // - -/** -* Sets the x-axis scale. -* -* @private -* @param {string} scale - axis scale -* @throws {TypeError} must be a string -* @returns {void} -*/ -function set( scale ) { - /* eslint-disable no-invalid-this */ - if ( !isString( scale ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'xScale', scale ) ); - } - // TODO: test for valid scale - - if ( scale !== this._xScale ) { - debug( 'Current value: %s.', this._xScale ); - - this._xScale = scale; - debug( 'New value: %s.', this._xScale ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x-tick-format/get.js b/ctor/lib/props/x-tick-format/get.js deleted file mode 100644 index 8a6fc70..0000000 --- a/ctor/lib/props/x-tick-format/get.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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( 'd3-format' ).format; // TODO: remove -var timeFormat = require( 'd3-time-format' ).timeFormat; // TODO: remove -var isNull = require( '@stdlib/assert/is-null' ); - - -// MAIN // - -/** -* Returns the x-axis tick format. -* -* @private -* @returns {(Function|null)} format function or null -*/ -function get() { - /* eslint-disable no-invalid-this */ - if ( isNull( this._xTickFormat ) ) { - return this._xTickFormat; - } - if ( this._xScale === 'time' ) { - return timeFormat( this._xTickFormat ); - } - return format( this._xTickFormat ); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x-tick-format/set.js b/ctor/lib/props/x-tick-format/set.js deleted file mode 100644 index c993625..0000000 --- a/ctor/lib/props/x-tick-format/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x-tick-format' ); - - -// MAIN // - -/** -* Sets the x-axis tick format. -* -* @private -* @param {(string|null)} fmt - axis tick format -* @throws {TypeError} must be a string -*/ -function set( fmt ) { - /* eslint-disable no-invalid-this */ - if ( !isNull( fmt ) && !isString( fmt ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or null. Value: `%s`.', 'xTickFormat', fmt ) ); - } - if ( fmt !== this._xTickFormat ) { - debug( 'Current value: %s.', this._xTickFormat ); - - this._xTickFormat = fmt; - debug( 'New value: %s.', this._xTickFormat ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/x/get.js b/ctor/lib/props/x/get.js deleted file mode 100644 index 1616853..0000000 --- a/ctor/lib/props/x/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the plot `x` values. -* -* @private -* @returns {Array} x values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._xData.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/x/set.js b/ctor/lib/props/x/set.js deleted file mode 100644 index 759f450..0000000 --- a/ctor/lib/props/x/set.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArray = require( '@stdlib/assert/is-array' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:x' ); - - -// MAIN // - -/** -* Sets the plot `x` values. -* -* @private -* @param {Array} x - x values -* @throws {TypeError} must be an array -* @returns {void} -*/ -function set( x ) { - /* eslint-disable no-invalid-this */ - if ( !isArray( x ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be an array. Value: `%s`.', 'x', x ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._xData ) ); - - this._xData = x.slice(); - debug( 'New Value: %s.', JSON.stringify( this._xData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-axis-orient/get.js b/ctor/lib/props/y-axis-orient/get.js deleted file mode 100644 index 599ea8e..0000000 --- a/ctor/lib/props/y-axis-orient/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis orientation. -* -* @private -* @returns {string} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yAxisOrient; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-axis-orient/orientations.json b/ctor/lib/props/y-axis-orient/orientations.json deleted file mode 100644 index d2d3df7..0000000 --- a/ctor/lib/props/y-axis-orient/orientations.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "left", - "right" -] diff --git a/ctor/lib/props/y-axis-orient/set.js b/ctor/lib/props/y-axis-orient/set.js deleted file mode 100644 index af65af2..0000000 --- a/ctor/lib/props/y-axis-orient/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './orientations.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-axis-orient' ); - - -// MAIN // - -/** -* Sets the y-axis orientation. -* -* @private -* @param {string} orientation - axis orientation -* @throws {TypeError} must be either `'left'` or `'right'` -*/ -function set( orientation ) { - /* eslint-disable no-invalid-this */ - if ( indexOf( ORIENTATIONS, orientation ) === -1 ) { - throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'yAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) ); - } - if ( orientation !== this._yAxisOrient ) { - debug( 'Current value: %s.', this._yAxisOrient ); - - this._yAxisOrient = orientation; - debug( 'New value: %s.', this._yAxisOrient ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-domain/get.js b/ctor/lib/props/y-domain/get.js deleted file mode 100644 index cf17fe4..0000000 --- a/ctor/lib/props/y-domain/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis domain. -* -* @private -* @returns {Array} domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - return [ this.yMin, this.yMax ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-label/get.js b/ctor/lib/props/y-label/get.js deleted file mode 100644 index 4b36a06..0000000 --- a/ctor/lib/props/y-label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yLabel; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-label/set.js b/ctor/lib/props/y-label/set.js deleted file mode 100644 index de534d8..0000000 --- a/ctor/lib/props/y-label/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-label' ); - - -// MAIN // - -/** -* Sets the y-axis label. -* -* @private -* @param {string} label - axis label -* @throws {TypeError} must be a string -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'yLabel', label ) ); - } - if ( label !== this._yLabel ) { - debug( 'Current value: %s.', this._yLabel ); - - this._yLabel = label; - debug( 'New value: %s.', this._yLabel ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-max/get.js b/ctor/lib/props/y-max/get.js deleted file mode 100644 index 562b624..0000000 --- a/ctor/lib/props/y-max/get.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var max = require( './../../utils/max.js' ); // TODO: replace with mod when written - - -// FUNCTIONS // - -/** -* Computes a maximum value. -* -* @private -* @param {Array} arr - input array -* @returns {(number|null)} maximum value or null -*/ -function getMax( arr ) { - var tmp; - var i; - if ( arr.length === 0 ) { - return null; - } - tmp = new Array( arr.length ); - for ( i = 0; i < arr.length; i++ ) { - tmp[ i ] = max( arr[ i ] ); - } - return max( tmp ); -} - - -// MAIN // - -/** -* Returns the maximum value of the y-axis domain. -* -* @private -* @returns {number} maximum value -*/ -function get() { - /* eslint-disable no-invalid-this */ - var max; - if ( isNull( this._yMax ) ) { - max = getMax( this._yData ); - return ( isNull( max ) ) ? 1.0 : max; - } - return this._yMax; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-max/set.js b/ctor/lib/props/y-max/set.js deleted file mode 100644 index ecda102..0000000 --- a/ctor/lib/props/y-max/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-max' ); - - -// MAIN // - -/** -* Sets the maximum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} max - maximum value -* @throws {TypeError} must be a finite number or null -* @returns {void} -*/ -function set( max ) { - /* eslint-disable no-invalid-this */ - if ( - !isNull( max ) && - !isNumber( max ) // FIXME: finite number - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or null. Value: `%s`.', 'yMax', max ) ); - } - if ( max !== this._yMax ) { - debug( 'Current value: %d.', this._yMax ); - - this._yMax = max; - debug( 'New value: %d.', this._yMax ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-min/get.js b/ctor/lib/props/y-min/get.js deleted file mode 100644 index f5fef9c..0000000 --- a/ctor/lib/props/y-min/get.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNull = require( '@stdlib/assert/is-null' ); -var min = require( './../../utils/min.js' ); // TODO: replace with mod when written - - -// FUNCTIONS // - -/** -* Computes a minimum value. -* -* @private -* @param {Array} arr - input array -* @returns {(number|null)} minimum value or null -*/ -function getMin( arr ) { - var tmp; - var i; - if ( arr.length === 0 ) { - return null; - } - tmp = new Array( arr.length ); - for ( i = 0; i < arr.length; i++ ) { - tmp[ i ] = min( arr[ i ] ); - } - return min( tmp ); -} - - -// MAIN // - -/** -* Returns the minimum value of the y-axis domain. -* -* @private -* @returns {number} minimum value -*/ -function get() { - /* eslint-disable no-invalid-this */ - var min; - if ( isNull( this._yMin ) ) { - min = getMin( this._yData ); - return ( isNull( min ) ) ? 0.0 : min; - } - return this._yMin; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-min/set.js b/ctor/lib/props/y-min/set.js deleted file mode 100644 index 808859f..0000000 --- a/ctor/lib/props/y-min/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-min' ); - - -// MAIN // - -/** -* Sets the minimum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} min - minimum value -* @throws {TypeError} must be a finite number or null -* @returns {void} -*/ -function set( min ) { - /* eslint-disable no-invalid-this */ - if ( - !isNull( min ) && - !isNumber( min ) // FIXME: finite number - ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or null. Value: `%s`.', 'yMin', min ) ); - } - if ( min !== this._yMin ) { - debug( 'Current value: %d.', this._yMin ); - - this._yMin = min; - debug( 'New value: %d.', this._yMin ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-num-ticks/get.js b/ctor/lib/props/y-num-ticks/get.js deleted file mode 100644 index 5aec4ef..0000000 --- a/ctor/lib/props/y-num-ticks/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the number of y-axis tick marks. -* -* @private -* @returns {(NonNegativeInteger|null)} number of ticks -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yNumTicks; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-num-ticks/set.js b/ctor/lib/props/y-num-ticks/set.js deleted file mode 100644 index 959e06d..0000000 --- a/ctor/lib/props/y-num-ticks/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-num-ticks' ); - - -// MAIN // - -/** -* Sets the number of y-axis tick marks. -* -* @private -* @param {(NonNegativeInteger|null)} ticks - number of ticks -* @throws {TypeError} must be a nonnegative integer or null -*/ -function set( ticks ) { - /* eslint-disable no-invalid-this */ - if ( !isNull( ticks ) && !isNonNegativeInteger( ticks ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'yNumTicks', ticks ) ); - } - if ( ticks !== this._yNumTicks ) { - debug( 'Current value: %d.', this._yNumTicks ); - - this._yNumTicks = ticks; - debug( 'New value: %d.', this._yNumTicks ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-pos/get.js b/ctor/lib/props/y-pos/get.js deleted file mode 100644 index f14489e..0000000 --- a/ctor/lib/props/y-pos/get.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'plot:y-pos' ); - - -// MAIN // - -/** -* Returns a function to map values to y-axis coordinate values. -* -* @private -* @returns {Function} map function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale = this.yScale; - return yPos; - - /** - * Maps a value to a y-axis coordinate value. - * - * @private - * @param {number} d - datum - * @returns {number} pixel value - */ - function yPos( d ) { - var px = scale( d ); - debug( 'Value: %d => Pixel: %d.', d, px ); - return px; - } -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-range/get.js b/ctor/lib/props/y-range/get.js deleted file mode 100644 index 8bf31ee..0000000 --- a/ctor/lib/props/y-range/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis range. -* -* @private -* @returns {NumberArray} range -*/ -function get() { - /* eslint-disable no-invalid-this */ - return [ this.graphHeight, 0 ]; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-rug-opacity/get.js b/ctor/lib/props/y-rug-opacity/get.js deleted file mode 100644 index 15b50f0..0000000 --- a/ctor/lib/props/y-rug-opacity/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis rug opacity. -* -* @private -* @returns {NumberArray} rug opacities -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yRugOpacity.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-rug-opacity/set.js b/ctor/lib/props/y-rug-opacity/set.js deleted file mode 100644 index d4ffa12..0000000 --- a/ctor/lib/props/y-rug-opacity/set.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isNumberArray = require( '@stdlib/assert/is-number-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-rug-opacity' ); - - -// MAIN // - -/** -* Sets the y-axis rug opacity. -* -* @private -* @param {(number|NumberArray)} v - opacity -* @throws {TypeError} must be a number or number array -* @throws {RangeError} must be a number on the interval `[0,1]` -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isNum = isNumber( v ); - var i; - if ( !isNum && !isNumberArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'yRugOpacity', v ) ); - } - if ( isNum ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( v[ i ] < 0.0 || v[ i ] > 1.0 ) { - throw new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'yRugOpacity', v[ i ] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._yRugOpacity ) ); - - this._yRugOpacity = v; - debug( 'New Value: %s.', JSON.stringify( this._yRugOpacity ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-rug-orient/get.js b/ctor/lib/props/y-rug-orient/get.js deleted file mode 100644 index 17005fc..0000000 --- a/ctor/lib/props/y-rug-orient/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis rug orientation. -* -* @private -* @returns {StringArray} orientation -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yRugOrient.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-rug-orient/orientations.json b/ctor/lib/props/y-rug-orient/orientations.json deleted file mode 100644 index d2d3df7..0000000 --- a/ctor/lib/props/y-rug-orient/orientations.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "left", - "right" -] diff --git a/ctor/lib/props/y-rug-orient/set.js b/ctor/lib/props/y-rug-orient/set.js deleted file mode 100644 index 59ced1c..0000000 --- a/ctor/lib/props/y-rug-orient/set.js +++ /dev/null @@ -1,74 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var indexOf = require( '@stdlib/utils/index-of' ); -var format = require( '@stdlib/string/format' ); -var ORIENTATIONS = require( './orientations.json' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-rug-orient' ); - - -// MAIN // - -/** -* Sets the y-axis rug orientation. -* -* @private -* @param {(string|StringArray)} v - rug orientation -* @throws {TypeError} must be either a string or string array -* @throws {TypeError} must be either `'bottom'` or `'top'` -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isStr = isString( v ); - var i; - if ( !isStr && !isStringArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'yRugOrient', v ) ); - } - if ( isStr ) { - v = [ v ]; - } else { - v = v.slice(); - } - for ( i = 0; i < v.length; i++ ) { - if ( indexOf( ORIENTATIONS, v[i] ) === -1 ) { - throw new TypeError( format( 'invalid assignment. Unrecognized/unsupported orientation. A `%s` value must be one of the following: "%s". Value: `%s`.', 'yRugOrient', ORIENTATIONS.join( '", "' ), v[i] ) ); - } - } - debug( 'Current value: %s.', JSON.stringify( this._yRugOrient ) ); - - this._yRugOrient = v; - debug( 'New value: %s.', JSON.stringify( this._yRugOrient ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-rug-size/get.js b/ctor/lib/props/y-rug-size/get.js deleted file mode 100644 index b880aaf..0000000 --- a/ctor/lib/props/y-rug-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis rug tick (tassel) size. -* -* @private -* @returns {Array} tick sizes -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yRugSize.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-rug-size/set.js b/ctor/lib/props/y-rug-size/set.js deleted file mode 100644 index 09d335e..0000000 --- a/ctor/lib/props/y-rug-size/set.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-rug-size' ); - - -// MAIN // - -/** -* Sets the y-axis rug tick (tassel) size. -* -* @private -* @param {(NonNegativeInteger|Array)} v - size -* @throws {TypeError} must be a nonnegative integer or nonnegative integer array -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isInt = isNonNegativeInteger( v ); - if ( !isInt && !isNonNegativeIntegerArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'yRugSize', v ) ); - } - if ( isInt ) { - v = [ v ]; - } else { - v = v.slice(); - } - debug( 'Current value: %s.', JSON.stringify( this._yRugSize ) ); - - this._yRugSize = v; - debug( 'New Value: %s.', JSON.stringify( this._yRugSize ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-rug/get.js b/ctor/lib/props/y-rug/get.js deleted file mode 100644 index df03aaa..0000000 --- a/ctor/lib/props/y-rug/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns whether a rug plot is displayed along the y-axis. -* -* @private -* @returns {BooleanArray} boolean flag -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yRug.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-rug/set.js b/ctor/lib/props/y-rug/set.js deleted file mode 100644 index 1547ae9..0000000 --- a/ctor/lib/props/y-rug/set.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var isBooleanArray = require( '@stdlib/assert/is-boolean-array' ).primitives; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-rug' ); - - -// MAIN // - -/** -* Sets a flag indicating whether to display a rug plot along the y-axis. -* -* @private -* @param {(boolean|BooleanArray)} v - boolean flag(s) indicating whether to display a rug plot along the y-axis -* @throws {TypeError} must be a boolean or boolean array -*/ -function set( v ) { - /* eslint-disable no-invalid-this */ - var isBool = isBoolean( v ); - if ( !isBool && !isBooleanArray( v ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean or an array of booleans. Value: `%s`.', 'yRug', v ) ); - } - if ( isBool ) { - v = [ v ]; - } - debug( 'Current value: %s.', JSON.stringify( this._yRug ) ); - - this._yRug = v; - debug( 'New Value: %s.', JSON.stringify( this._yRug ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-scale/get.js b/ctor/lib/props/y-scale/get.js deleted file mode 100644 index e025d85..0000000 --- a/ctor/lib/props/y-scale/get.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 linear = require( 'd3-scale' ).scaleLinear; // TODO: remove -var time = require( 'd3-scale' ).scaleTime; // TODO: remove - - -// MAIN // - -/** -* Returns a scale function for mapping values to a coordinate along the y-axis. -* -* @private -* @returns {Function} scale function -*/ -function get() { - /* eslint-disable no-invalid-this */ - var scale; - if ( this._yScale === 'time' ) { - scale = time() - .domain( this.yDomain ) - .range( this.yRange ); - } else if ( this._yScale === 'linear' ) { - scale = linear() - .domain( this.yDomain ) - .range( this.yRange ); - } - // TODO: other scales - return scale; -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-scale/set.js b/ctor/lib/props/y-scale/set.js deleted file mode 100644 index 3b7c395..0000000 --- a/ctor/lib/props/y-scale/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-scale' ); - - -// MAIN // - -/** -* Sets the y-axis scale. -* -* @private -* @param {string} scale - axis scale -* @throws {TypeError} must be a string -* @returns {void} -*/ -function set( scale ) { - /* eslint-disable no-invalid-this */ - if ( !isString( scale ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'yScale', scale ) ); - } - // TODO: test for valid scale - - debug( 'Current value: %s.', this._yScale ); - - this._yScale = scale; - debug( 'New value: %s.', this._yScale ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y-tick-format/get.js b/ctor/lib/props/y-tick-format/get.js deleted file mode 100644 index 923bf4b..0000000 --- a/ctor/lib/props/y-tick-format/get.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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( 'd3-format' ).format; // TODO: remove -var timeFormat = require( 'd3-time-format' ).timeFormat; // TODO: remove -var isNull = require( '@stdlib/assert/is-null' ); - - -// MAIN // - -/** -* Returns the y-axis tick format. -* -* @private -* @returns {(Function|null)} format function or null -*/ -function get() { - /* eslint-disable no-invalid-this */ - if ( isNull( this._yTickFormat ) ) { - return this._yTickFormat; - } - if ( this._yScale === 'time' ) { - return timeFormat( this._yTickFormat ); - } - return format( this._yTickFormat ); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y-tick-format/set.js b/ctor/lib/props/y-tick-format/set.js deleted file mode 100644 index 843f201..0000000 --- a/ctor/lib/props/y-tick-format/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isNull = require( '@stdlib/assert/is-null' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y-tick-format' ); - - -// MAIN // - -/** -* Sets the y-axis tick format. -* -* @private -* @param {(string|null)} fmt - axis tick format -* @throws {TypeError} must be a string or null -*/ -function set( fmt ) { - /* eslint-disable no-invalid-this */ - if ( !isNull( fmt ) && !isString( fmt ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or null. Value: `%s`.', 'yTickFormat', fmt ) ); - } - if ( fmt !== this._yTickFormat ) { - debug( 'Current value: %s.', this._yTickFormat ); - - this._yTickFormat = fmt; - debug( 'New value: %s.', this._yTickFormat ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/props/y/get.js b/ctor/lib/props/y/get.js deleted file mode 100644 index 1808d29..0000000 --- a/ctor/lib/props/y/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the plot `y` values. -* -* @private -* @returns {Array} y values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yData.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/ctor/lib/props/y/set.js b/ctor/lib/props/y/set.js deleted file mode 100644 index 375b0d7..0000000 --- a/ctor/lib/props/y/set.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isArray = require( '@stdlib/assert/is-array' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:y' ); - - -// MAIN // - -/** -* Sets the plot `y` values. -* -* @private -* @param {Array} y - y values -* @throws {TypeError} must be an array -* @returns {void} -*/ -function set( y ) { - /* eslint-disable no-invalid-this */ - if ( !isArray( y ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be an array. Value: `%s`.', 'y', y ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._yData ) ); - - this._yData = y.slice(); - debug( 'New Value: %s.', JSON.stringify( this._yData ) ); - - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/ctor/lib/render/index.js b/ctor/lib/render/index.js deleted file mode 100644 index 8b4c254..0000000 --- a/ctor/lib/render/index.js +++ /dev/null @@ -1,81 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var vdom2html = require( 'vdom-to-html' ); -var renderSVG = require( './svg' ); -var validate = require( './validate.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:render' ); - - -// MAIN // - -/** -* Renders a plot. -* -* @private -* @param {string} [format] - render format -* @returns {(VTree|string)} virtual tree or a string -*/ -function render( format ) { - /* eslint-disable no-invalid-this */ - var out; - var tmp; - var fmt; - - tmp = this.renderFormat; - if ( arguments.length ) { - // Temporarily set the render format: - this.renderFormat = format; - fmt = format; - } else { - fmt = tmp; - } - debug( 'Validating render state...' ); - validate( this ); - - debug( 'Render format: %s.', this.renderFormat ); - debug( 'Rendering...' ); - if ( this._engine === 'svg' ) { - out = renderSVG( this ); - - // Default render format is virtual DOM. - if ( fmt === 'html' ) { - out = vdom2html( out ); - } - this.emit( 'render', out ); - } - if ( arguments.length ) { - // Restore the render format: - this.renderFormat = tmp; - } - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/index.js b/ctor/lib/render/svg/index.js deleted file mode 100644 index 2d0c632..0000000 --- a/ctor/lib/render/svg/index.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var xAxisTransform = require( './utils/x_axis_transform.js' ); -var yAxisTransform = require( './utils/y_axis_transform.js' ); -var renderMarks = require( './marks' ); -var init = require( './init.js' ); -var sync = require( './sync.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:main' ); - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var annotations; - var clipPath; - var canvas; - var title; - var graph; - var marks; - var xAxis; - var yAxis; - var bkgd; - var defs; - var svg; - - svg = state.$.svg; - - // Lazily initialize... - if ( !svg.canvas ) { - debug( 'Initializing components...' ); - init( state ); - } - debug( 'Syncing component states...' ); - sync( state ); - - debug( 'Rendering individual components...' ); - - debug( 'Rendering annotations...' ); - annotations = svg.annotations.render(); - - debug( 'Rendering clip-path...' ); - clipPath = svg.clipPath.render(); - - debug( 'Rendering canvas...' ); - canvas = svg.canvas.render(); - - debug( 'Rendering graph...' ); - graph = svg.graph.render(); - - debug( 'Rendering title...' ); - title = svg.title.render(); - - debug( 'Rendering x-axis...' ); - xAxis = svg.xAxis.render(); - - debug( 'Rendering y-axis...' ); - yAxis = svg.yAxis.render(); - - debug( 'Rendering background...' ); - bkgd = svg.bkgd.render(); - - debug( 'Rendering definitions...' ); - defs = svg.defs.render(); - - debug( 'Rendering marks...' ); - marks = renderMarks( state ); - - debug( 'Updating rendered components...' ); - - debug( 'Updating title...' ); - title.properties.attributes.x = state.paddingLeft + ( state.graphWidth/2 ); - title.properties.attributes.y = state.paddingTop / 2; - - debug( 'Updating x-axis...' ); - xAxis.properties.className += ' x'; - xAxis.properties.attributes.transform = xAxisTransform( state.xAxisOrient, state.graphHeight ); // eslint-disable-line max-len - - debug( 'Updating y-axis...' ); - yAxis.properties.className += ' y'; - yAxis.properties.attributes.transform = yAxisTransform( state.yAxisOrient, state.graphWidth ); // eslint-disable-line max-len - - debug( 'Assembling virtual tree...' ); - - debug( 'Inserting clip-path into definitions...' ); - defs.children.push( clipPath ); - defs.count += clipPath.count; - - debug( 'Inserting background into graph...' ); - graph.children.push( bkgd ); - graph.count += bkgd.count; - - debug( 'Inserting marks into graph...' ); - graph.children.push( marks ); - graph.count += marks.count; - - debug( 'Inserting x-axis into graph...' ); - graph.children.push( xAxis ); - graph.count += xAxis.count; - - debug( 'Inserting y-axis into graph...' ); - graph.children.push( yAxis ); - graph.count += yAxis.count; - - debug( 'Inserting title into annotations...' ); - annotations.children.push( title ); - annotations.count += title.count; - - debug( 'Inserting definitions into canvas...' ); - canvas.children.push( defs ); - canvas.count += defs.count; - - debug( 'Inserting graph into canvas...' ); - canvas.children.push( graph ); - canvas.count += graph.count; - - debug( 'Inserting annotations into canvas...' ); - canvas.children.push( annotations ); - canvas.count += annotations.count; - - return canvas; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/init.js b/ctor/lib/render/svg/init.js deleted file mode 100644 index 3ab91c8..0000000 --- a/ctor/lib/render/svg/init.js +++ /dev/null @@ -1,205 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var Annotations = require( './../../../../components/svg/annotations' ); -var ClipPath = require( './../../../../components/svg/clip-path' ); -var Canvas = require( './../../../../components/svg/canvas' ); -var Graph = require( './../../../../components/svg/graph' ); -var Title = require( './../../../../components/svg/title' ); -var Marks = require( './../../../../components/svg/marks' ); -var Bkgd = require( './../../../../components/svg/background' ); -var Defs = require( './../../../../components/svg/defs' ); -var Axis = require( './../../../../components/svg/axis' ); -var Path = require( './../../../../components/svg/path' ); -var Symbols = require( './../../../../components/svg/symbols' ); -var Rug = require( './../../../../components/svg/rug' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:init' ); - - -// MAIN // - -/** -* Initializes SVG components. -* -* @private -* @param {Object} state - state -*/ -function init( state ) { - var svg = state.$.svg; - - debug( 'Initializing components...' ); - - debug( 'Initializing canvas component...' ); - defineProperty( svg, 'canvas', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Canvas({ - 'autoRender': false - }) - }); - - debug( 'Initializing definitions component...' ); - defineProperty( svg, 'defs', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Defs({ - 'autoRender': false - }) - }); - - debug( 'Initializing clipping path component...' ); - defineProperty( svg, 'clipPath', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new ClipPath({ - 'autoRender': false, - 'id': state._clipPathId // eslint-disable-line no-underscore-dangle - }) - }); - - debug( 'Initializing graph component...' ); - defineProperty( svg, 'graph', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Graph({ - 'autoRender': false - }) - }); - - debug( 'Initializing annotations component...' ); - defineProperty( svg, 'annotations', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Annotations({ - 'autoRender': false - }) - }); - - debug( 'Initializing title component...' ); - defineProperty( svg, 'title', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Title({ - 'autoRender': false - }) - }); - - debug( 'Initializing background component...' ); - defineProperty( svg, 'bkgd', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Bkgd({ - 'autoRender': false - }) - }); - - debug( 'Initializing marks component...' ); - defineProperty( svg, 'marks', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Marks({ - 'autoRender': false, - 'clipPathId': state._clipPathId // eslint-disable-line no-underscore-dangle - }) - }); - - debug( 'Initializing path component...' ); - defineProperty( svg, 'path', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Path({ - 'autoRender': false - }) - }); - - debug( 'Initializing symbols component...' ); - defineProperty( svg, 'symbols', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Symbols({ - 'autoRender': false - }) - }); - - debug( 'Initializing x-axis rug component...' ); - defineProperty( svg, 'xRug', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Rug({ - 'autoRender': false - }) - }); - - debug( 'Initializing y-axis rug component...' ); - defineProperty( svg, 'yRug', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Rug({ - 'autoRender': false - }) - }); - - debug( 'Initializing x-axis component...' ); - defineProperty( svg, 'xAxis', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Axis({ - 'autoRender': false - }) - }); - - debug( 'Initializing y-axis component...' ); - defineProperty( svg, 'yAxis', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Axis({ - 'autoRender': false - }) - }); - - debug( 'All components initialized.' ); -} - - -// EXPORTS // - -module.exports = init; diff --git a/ctor/lib/render/svg/marks/index.js b/ctor/lib/render/svg/marks/index.js deleted file mode 100644 index 0c69a27..0000000 --- a/ctor/lib/render/svg/marks/index.js +++ /dev/null @@ -1,84 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var lines = require( './lines.js' ); -var symbols = require( './symbols.js' ); -var xRug = require( './x_rug.js' ); -var yRug = require( './y_rug.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:marks' ); - - -// MAIN // - -/** -* Renders individual marks. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var parent; - var marks; - var len; - var i; - - debug( 'Rendering marks group...' ); - parent = state.$.svg.marks.render(); - - len = state.x.length; - if ( len === 0 ) { - debug( 'No individual marks to render.' ); - return parent; - } - marks = []; - - debug( 'Rendering lines...' ); - marks = marks.concat( lines( state ) ); - - debug( 'Rendering symbols...' ); - marks = marks.concat( symbols( state ) ); - - debug( 'Rendering x-axis rug plots...' ); - marks = marks.concat( xRug( state ) ); - - debug( 'Rendering y-axis rug plots...' ); - marks = marks.concat( yRug( state ) ); - - debug( 'Inserting individual marks into marks group...' ); - for ( i = 0; i < marks.length; i++ ) { - parent.children.push( marks[i] ); - parent.count += marks[i].count; - } - debug( 'Finished rendering marks.' ); - return parent; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/marks/lines.js b/ctor/lib/render/svg/marks/lines.js deleted file mode 100644 index f9dd8a2..0000000 --- a/ctor/lib/render/svg/marks/lines.js +++ /dev/null @@ -1,99 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:marks:lines' ); - - -// MAIN // - -/** -* Renders line marks. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var nOpacities; - var lineStyle; - var opacity; - var nColors; - var nStyles; - var nWidths; - var color; - var width; - var marks; - var line; - var len; - var i; - - line = state.$.svg.path; - nOpacities = state.lineOpacity.length; - nStyles = state.lineStyle.length; - nWidths = state.lineWidth.length; - nColors = state.colors.length; - - len = state.x.length; - marks = []; - - debug( 'Rendering lines...' ); - for ( i = 0; i < len; i++ ) { - lineStyle = state.lineStyle[ i%nStyles ]; - debug( 'Line style: %s (%d).', lineStyle, i ); - - if ( lineStyle === 'none' ) { - debug( 'Line style (%d) is `none`. Skipping...', i ); - continue; - } - color = state.colors[ i%nColors ]; - debug( 'Line color: %s (%d).', color, i ); - - opacity = state.lineOpacity[ i%nOpacities ]; - debug( 'Line opacity: %s (%d).', opacity, i ); - - width = state.lineWidth[ i%nWidths ]; - debug( 'Line width: %s (%d).', width, i ); - - line.x = state.x[ i ]; - line.y = state.y[ i ]; - line.style = lineStyle; - line.label = state.labels[ i ] || ''; - line.color = color; - line.opacity = opacity; - line.width = width; - - debug( 'Rendering line %d...', i ); - marks.push( line.render() ); - } - debug( 'Finished rendering lines.' ); - return marks; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/marks/symbols.js b/ctor/lib/render/svg/marks/symbols.js deleted file mode 100644 index 53f3cf8..0000000 --- a/ctor/lib/render/svg/marks/symbols.js +++ /dev/null @@ -1,99 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:marks:symbols' ); - - -// MAIN // - -/** -* Renders symbols marks. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var nOpacities; - var nSymbols; - var nColors; - var opacity; - var nSizes; - var symbol; - var color; - var marks; - var size; - var sym; - var len; - var i; - - sym = state.$.svg.symbols; - nOpacities = state.symbolsOpacity.length; - nSymbols = state.symbols.length; - nColors = state.colors.length; - nSizes = state.symbolsSize.length; - - len = state.x.length; - marks = []; - - debug( 'Rendering symbols...' ); - for ( i = 0; i < len; i++ ) { - symbol = state.symbols[ i%nSymbols ]; - debug( 'Symbol: %s (%d).', symbol, i ); - - if ( symbol === 'none' ) { - debug( 'Symbol (%d) is `none`. Skipping...', i ); - continue; - } - opacity = state.symbolsOpacity[ i%nOpacities ]; - debug( 'Symbols opacity: %d (%d).', opacity, i ); - - size = state.symbolsSize[ i%nSizes ]; - debug( 'Symbols size: %d (%d).', size, i ); - - color = state.colors[ i%nColors ]; - debug( 'Symbols color: %s (%d).', color, i ); - - sym.x = state.x[ i ]; - sym.y = state.y[ i ]; - sym.symbol = symbol; - sym.label = state.labels[ i ] || ''; - sym.color = color; - sym.size = size; - sym.opacity = opacity; - - debug( 'Rendering symbols %d...', i ); - marks.push( sym.render() ); - } - debug( 'Finished rendering symbols.' ); - return marks; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/marks/x_rug.js b/ctor/lib/render/svg/marks/x_rug.js deleted file mode 100644 index 9a396d4..0000000 --- a/ctor/lib/render/svg/marks/x_rug.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var xRugTransform = require( './../utils/x_rug_transform.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:marks:x-rug' ); - - -// MAIN // - -/** -* Renders x-axis rug plots. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var rugTransform; - var nOpacities; - var nOrients; - var opacity; - var nColors; - var nSizes; - var orient; - var nFlgs; - var color; - var marks; - var size; - var rug; - var len; - var tmp; - var i; - - rug = state.$.svg.xRug; - - nOpacities = state.xRugOpacity.length; - nOrients = state.xRugOrient.length; - nColors = state.colors.length; - nSizes = state.xRugSize.length; - nFlgs = state.xRug.length; - - len = state.x.length; - marks = []; - - debug( 'Rendering x-axis rug plots...' ); - for ( i = 0; i < len; i++ ) { - if ( !state.xRug[ i%nFlgs ] ) { - debug( 'Rug plot (%d) disabled. Skipping...', i ); - continue; - } - color = state.colors[ i%nColors ]; - debug( 'Rug color: %s (%d).', color, i ); - - opacity = state.xRugOpacity[ i%nOpacities ]; - debug( 'Rug opacity: %d (%d).', opacity, i ); - - orient = state.xRugOrient[ i%nOrients ]; - debug( 'Rug orientation: %s (%d).', orient, i ); - - size = state.xRugSize[ i%nSizes ]; - debug( 'Rug tick size: %d (%d).', size, i ); - - rug.data = state.x[ i ]; - rug.label = state.labels[ i ] || ''; - rug.color = color; - rug.size = size; - rug.opacity = opacity; - rug.orientation = orient; - - debug( 'Rendering x-axis rug %d...', i ); - tmp = rug.render(); - - // Update the class name to indicate this is an x-axis rug and add a transform to translate the rug into position based on the graph dimensions. - tmp.properties.className += ' x'; - rugTransform = xRugTransform( orient, state.graphHeight ); - if ( !tmp.properties.attributes ) { - tmp.properties.attributes = {}; - } - tmp.properties.attributes.transform = rugTransform; - - marks.push( tmp ); - } - debug( 'Finished rendering x-axis rug plots.' ); - return marks; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/marks/y_rug.js b/ctor/lib/render/svg/marks/y_rug.js deleted file mode 100644 index 992dc60..0000000 --- a/ctor/lib/render/svg/marks/y_rug.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var yRugTransform = require( './../utils/y_rug_transform.js' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:marks:y-rug' ); - - -// MAIN // - -/** -* Renders y-axis rug plots. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var rugTransform; - var nOpacities; - var nOrients; - var opacity; - var nColors; - var nSizes; - var orient; - var nFlgs; - var color; - var marks; - var size; - var rug; - var len; - var tmp; - var i; - - rug = state.$.svg.yRug; - - nOpacities = state.yRugOpacity.length; - nOrients = state.yRugOrient.length; - nColors = state.colors.length; - nSizes = state.yRugSize.length; - nFlgs = state.yRug.length; - - len = state.y.length; - marks = []; - - debug( 'Rendering y-axis rug plots...' ); - for ( i = 0; i < len; i++ ) { - if ( !state.yRug[ i%nFlgs ] ) { - debug( 'Rug plot (%d) disabled. Skipping...', i ); - continue; - } - color = state.colors[ i%nColors ]; - debug( 'Rug color: %s (%d).', color, i ); - - opacity = state.yRugOpacity[ i%nOpacities ]; - debug( 'Rug opacity: %d (%d).', opacity, i ); - - orient = state.yRugOrient[ i%nOrients ]; - debug( 'Rug orientation: %s (%d).', orient, i ); - - size = state.yRugSize[ i%nSizes ]; - debug( 'Rug tick size: %d (%d).', size, i ); - - rug.data = state.y[ i ]; - rug.label = state.labels[ i ] || ''; - rug.color = color; - rug.size = size; - rug.opacity = opacity; - rug.orientation = orient; - - debug( 'Rendering y-axis rug %d...', i ); - tmp = rug.render(); - - // Update the class name to indicate this is a y-axis rug and add a transform to translate the rug into position based on the graph dimensions. - tmp.properties.className += ' y'; - rugTransform = yRugTransform( orient, state.graphWidth ); - if ( !tmp.properties.attributes ) { - tmp.properties.attributes = {}; - } - tmp.properties.attributes.transform = rugTransform; - - marks.push( tmp ); - } - debug( 'Finished rendering y-axis rug plots.' ); - return marks; -} - - -// EXPORTS // - -module.exports = render; diff --git a/ctor/lib/render/svg/sync.js b/ctor/lib/render/svg/sync.js deleted file mode 100644 index 1777d32..0000000 --- a/ctor/lib/render/svg/sync.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'plot:render:svg:sync' ); - - -// MAIN // - -/** -* Syncs SVG components with the current state. -* -* @private -* @param {Object} state - state -*/ -function sync( state ) { - var svg = state.$.svg; - - debug( 'Syncing...' ); - - debug( 'Syncing canvas...' ); - svg.canvas.width = state.width; - svg.canvas.height = state.height; - - debug( 'Syncing definitions...' ); - - // ... - - debug( 'Syncing clipping path...' ); - svg.clipPath.width = state.graphWidth; - svg.clipPath.height = state.graphHeight; - - debug( 'Syncing graph...' ); - svg.graph.translateX = state.paddingLeft; - svg.graph.translateY = state.paddingTop; - - debug( 'Syncing annotations...' ); - - // ... - - debug( 'Syncing title...' ); - svg.title.text = state.title; - - debug( 'Syncing background...' ); - svg.bkgd.width = state.graphWidth; - svg.bkgd.height = state.graphHeight; - - debug( 'Syncing marks...' ); - svg.marks.clipPathId = state._clipPathId; // eslint-disable-line no-underscore-dangle - - debug( 'Syncing path...' ); - svg.path.xScale = state.xScale; - svg.path.yScale = state.yScale; - - // svg.path.isDefined = state.isDefined; // TODO - - debug( 'Syncing symbols...' ); - svg.symbols.xScale = state.xScale; - svg.symbols.yScale = state.yScale; - - // svg.symbols.isDefined = state.isDefined; // TODO - - debug( 'Syncing x-axis rug...' ); - svg.xRug.scale = state.xScale; - - // svg.xRug.isDefined = state.isDefined; // TODO - - debug( 'Syncing y-axis rug...' ); - svg.yRug.scale = state.yScale; - - // svg.yRug.isDefined = state.isDefined; // TODO - - debug( 'Syncing x-axis...' ); - svg.xAxis.scale = state.xScale; - svg.xAxis.label = state.xLabel; - svg.xAxis.tickFormat = state.xTickFormat; - svg.xAxis.numTicks = state.xNumTicks; - svg.xAxis.orientation = state.xAxisOrient; - - debug( 'Syncing y-axis...' ); - svg.yAxis.scale = state.yScale; - svg.yAxis.label = state.yLabel; - svg.yAxis.tickFormat = state.yTickFormat; - svg.yAxis.numTicks = state.yNumTicks; - svg.yAxis.orientation = state.yAxisOrient; - - debug( 'Sync complete.' ); -} - - -// EXPORTS // - -module.exports = sync; diff --git a/ctor/lib/render/svg/utils/x_axis_transform.js b/ctor/lib/render/svg/utils/x_axis_transform.js deleted file mode 100644 index dba6773..0000000 --- a/ctor/lib/render/svg/utils/x_axis_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns an x-axis translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} height - graph height -* @returns {string} transform -*/ -function xAxisTransform( orient, height ) { - if ( orient === 'top' ) { - return 'translate(0,0)'; - } - return 'translate(0,'+height+')'; -} - - -// EXPORTS // - -module.exports = xAxisTransform; diff --git a/ctor/lib/render/svg/utils/x_rug_transform.js b/ctor/lib/render/svg/utils/x_rug_transform.js deleted file mode 100644 index 323ed86..0000000 --- a/ctor/lib/render/svg/utils/x_rug_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns an x-axis rug translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} height - graph height -* @returns {string} transform -*/ -function xRugTransform( orient, height ) { - if ( orient === 'top' ) { - return 'translate(0,0)'; - } - return 'translate(0,'+height+')'; -} - - -// EXPORTS // - -module.exports = xRugTransform; diff --git a/ctor/lib/render/svg/utils/y_axis_transform.js b/ctor/lib/render/svg/utils/y_axis_transform.js deleted file mode 100644 index 2373863..0000000 --- a/ctor/lib/render/svg/utils/y_axis_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a y-axis translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} width - graph width -* @returns {string} transform -*/ -function yAxisTransform( orient, width ) { - if ( orient === 'left' ) { - return 'translate(0,0)'; - } - return 'translate('+width+',0)'; -} - - -// EXPORTS // - -module.exports = yAxisTransform; diff --git a/ctor/lib/render/svg/utils/y_rug_transform.js b/ctor/lib/render/svg/utils/y_rug_transform.js deleted file mode 100644 index 015f731..0000000 --- a/ctor/lib/render/svg/utils/y_rug_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a y-axis rug translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} width - graph width -* @returns {string} transform -*/ -function yRugTransform( orient, width ) { - if ( orient === 'left' ) { - return 'translate(0,0)'; - } - return 'translate('+width+',0)'; -} - - -// EXPORTS // - -module.exports = yRugTransform; diff --git a/ctor/lib/render/validate.js b/ctor/lib/render/validate.js deleted file mode 100644 index c47d814..0000000 --- a/ctor/lib/render/validate.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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' ); - - -// MAIN // - -/** -* Validates that an instance is in a valid state for rendering. -* -* @private -* @param {Object} state - state -* @throws {Error} must be in a valid state to render -*/ -function validate( state ) { - /* eslint-disable no-underscore-dangle */ - var x; - var y; - var i; - - x = state._xData; - y = state._yData; - if ( x.length !== y.length ) { - throw new Error( format( 'invalid state. x and y are different lengths. x length: `%u`. y length: `%u`.', x.length, y.length ) ); - } - // TODO: will need to refactor to some degree to support `ndarray`-like `x` and `y` - for ( i = 0; i < x.length; i++ ) { - if ( x[ i ].length !== y[ i ].length ) { - throw new Error( format( 'invalid state. Each `x[i]:y[i]` pair must be the same length. x[%u].length: `%u`, y[%u].length: `%u`.', i, x[i].length, i, y[i].length ) ); - } - } -} - - -// EXPORTS // - -module.exports = validate; diff --git a/ctor/lib/utils/max.js b/ctor/lib/utils/max.js deleted file mode 100644 index 9800f1e..0000000 --- a/ctor/lib/utils/max.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Computes a maximum value. -* -* @private -* @param {NumericArray} arr - input array -* @returns {(number|null)} maximum value or null -*/ -function getMax( arr ) { - var max; - var i; - if ( arr.length === 0 ) { - return null; - } - max = arr[ 0 ]; - for ( i = 1; i < arr.length; i++ ) { - if ( arr[ i ] > max ) { - max = arr[ i ]; - } - } - return max; -} - - -// EXPORTS // - -module.exports = getMax; diff --git a/ctor/lib/utils/min.js b/ctor/lib/utils/min.js deleted file mode 100644 index a8a5878..0000000 --- a/ctor/lib/utils/min.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Computes a minimum value. -* -* @private -* @param {NumericArray} arr - input array -* @returns {(number|null)} minimum value or null -*/ -function getMin( arr ) { - var min; - var i; - if ( arr.length === 0 ) { - return null; - } - min = arr[ 0 ]; - for ( i = 1; i < arr.length; i++ ) { - if ( arr[ i ] < min ) { - min = arr[ i ]; - } - } - return min; -} - - -// EXPORTS // - -module.exports = getMin; diff --git a/ctor/lib/view/browser/index.html b/ctor/lib/view/browser/index.html deleted file mode 100644 index 79dc0c8..0000000 --- a/ctor/lib/view/browser/index.html +++ /dev/null @@ -1,708 +0,0 @@ - - - - - - - - -   - - - - - -
{{plot}}
- - diff --git a/ctor/lib/view/browser/index.js b/ctor/lib/view/browser/index.js deleted file mode 100644 index f47b382..0000000 --- a/ctor/lib/view/browser/index.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 path = require( 'path' ); -var toHTML = require( 'vdom-to-html' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var httpServer = require( '@stdlib/net/disposable-http-server' ); - - -// MAIN // - -/** -* Opens a plot in a browser window. -* -* @private -* @param {VTree} vtree - virtual DOM tree -*/ -function view( vtree ) { - var index; - var html; - - // Transform the virtual DOM tree to HTML: - html = toHTML( vtree ); - - // Inject the HTML: - index = path.join( __dirname, 'index.html' ); - index = readFileSync( index, { - 'encoding': 'utf8' - }); - - index = index.replace( /\{\{plot\}\}/, html ); - - // Create a disposable HTTP server: - httpServer({ - 'html': index, - 'open': true - }); -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/lib/view/electron/css/colors.css b/ctor/lib/view/electron/css/colors.css deleted file mode 100644 index 4aef35f..0000000 --- a/ctor/lib/view/electron/css/colors.css +++ /dev/null @@ -1,523 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -/* D3: Category10 */ -.category10-1, -[data-color="category10-1"] { - stroke: #1f77b4; -} -.category10-2, -[data-color="category10-2"] { - stroke: #ff7f0e; -} -.category10-3, -[data-color="category10-3"] { - stroke: #2ca02c; -} -.category10-4, -[data-color="category10-4"] { - stroke: #d62728; -} -.category10-5, -[data-color="category10-5"] { - stroke: #9467bd; -} -.category10-6, -[data-color="category10-6"] { - stroke: #8c564b; -} -.category10-7, -[data-color="category10-7"] { - stroke: #e377c2; -} -.category10-8, -[data-color="category10-8"] { - stroke: #7f7f7f; -} -.category10-9, -[data-color="category10-9"] { - stroke: #bcdb22; -} -.category10-10, -[data-color="category10-10"] { - stroke: #17becf; -} - -/* D3: category20 */ -.category20-1, -[data-color="category20-1"] { - stroke: #1f77b4; -} -.category20-2, -[data-color="category20-2"] { - stroke: #aec7e8; -} -.category20-3, -[data-color="category20-3"] { - stroke: #ff7f0e; -} -.category20-4, -[data-color="category20-4"] { - stroke: #ffbb78; -} -.category20-5, -[data-color="category20-5"] { - stroke: #2ca02c; -} -.category20-6, -[data-color="category20-6"] { - stroke: #98df8a; -} -.category20-7, -[data-color="category20-7"] { - stroke: #d62728; -} -.category20-8, -[data-color="category20-8"] { - stroke: #ff9896; -} -.category20-9, -[data-color="category20-9"] { - stroke: #9467bd; -} -.category20-10, -[data-color="category20-10"] { - stroke: #c5b0d5; -} -.category20-11, -[data-color="category20-11"] { - stroke: #8c564b; -} -.category20-12, -[data-color="category20-12"] { - stroke: #c49c94; -} -.category20-13, -[data-color="category20-13"] { - stroke: #e377c2; -} -.category20-14, -[data-color="category20-14"] { - stroke: #f7b6d2; -} -.category20-15, -[data-color="category20-15"] { - stroke: #7f7f7f; -} -.category20-16, -[data-color="category20-16"] { - stroke: #c7c7c7; -} -.category20-17, -[data-color="category20-17"] { - stroke: #bcbd22; -} -.category20-18, -[data-color="category20-18"] { - stroke: #dbdb8d; -} -.category20-19, -[data-color="category20-19"] { - stroke: #17becf; -} -.category20-20, -[data-color="category20-20"] { - stroke: #9edae5; -} - -/* D3: category20b */ -.category20b-1, -[data-color="category20b-1"] { - stroke: #393b79; -} -.category20b-2, -[data-color="category20b-2"] { - stroke: #5254a3; -} -.category20b-3, -[data-color="category20b-3"] { - stroke: #6b6ecf; -} -.category20b-4, -[data-color="category20b-4"] { - stroke: #9c9ede; -} -.category20b-5, -[data-color="category20b-5"] { - stroke: #637939; -} -.category20b-6, -[data-color="category20b-6"] { - stroke: #8ca252; -} -.category20b-7, -[data-color="category20b-7"] { - stroke: #b5cf6b; -} -.category20b-8, -[data-color="category20b-8"] { - stroke: #cedb9c; -} -.category20b-9, -[data-color="category20b-9"] { - stroke: #8c6d31; -} -.category20b-10, -[data-color="category20b-10"] { - stroke: #bd9e39; -} -.category20b-11, -[data-color="category20b-11"] { - stroke: #e7ba52; -} -.category20b-12, -[data-color="category20b-12"] { - stroke: #e7cb94; -} -.category20b-13, -[data-color="category20b-13"] { - stroke: #843c39; -} -.category20b-14, -[data-color="category20b-14"] { - stroke: #ad494a; -} -.category20b-15, -[data-color="category20b-15"] { - stroke: #d6616b; -} -.category20b-16, -[data-color="category20b-16"] { - stroke: #e7969c; -} -.category20b-17, -[data-color="category20b-17"] { - stroke: #7b4173; -} -.category20b-18, -[data-color="category20b-18"] { - stroke: #a55194; -} -.category20b-19, -[data-color="category20b-19"] { - stroke: #ce6dbd; -} -.category20b-20, -[data-color="category20b-20"] { - stroke: #de9ed6; -} - -/* D3: category20c */ -.category20c-1, -[data-color="category20c-1"] { - stroke: #3182bd; -} -.category20c-2, -[data-color="category20c-2"] { - stroke: #6baed6; -} -.category20c-3, -[data-color="category20c-3"] { - stroke: #9ecae1; -} -.category20c-4, -[data-color="category20c-4"] { - stroke: #c6dbef; -} -.category20c-5, -[data-color="category20c-5"] { - stroke: #e6550d; -} -.category20c-6, -[data-color="category20c-6"] { - stroke: #fd8d3c; -} -.category20c-7, -[data-color="category20c-7"] { - stroke: #fdae6b; -} -.category20c-8, -[data-color="category20c-8"] { - stroke: #fdd0a2; -} -.category20c-9, -[data-color="category20c-9"] { - stroke: #31a354; -} -.category20c-10, -[data-color="category20c-10"] { - stroke: #74c476; -} -.category20c-11, -[data-color="category20c-11"] { - stroke: #a1d99b; -} -.category20c-12, -[data-color="category20c-12"] { - stroke: #c7e9c0; -} -.category20c-13, -[data-color="category20c-13"] { - stroke: #756bb1; -} -.category20c-14, -[data-color="category20c-14"] { - stroke: #9e9ac8; -} -.category20c-15, -[data-color="category20c-15"] { - stroke: #bcbddc; -} -.category20c-16, -[data-color="category20c-16"] { - stroke: #dadaeb; -} -.category20c-17, -[data-color="category20c-17"] { - stroke: #636363; -} -.category20c-18, -[data-color="category20c-18"] { - stroke: #969696; -} -.category20c-19, -[data-color="category20c-19"] { - stroke: #bdbdbd; -} -.category20c-20, -[data-color="category20c-20"] { - stroke: #d9d9d9; -} - -/* D3: Category10 */ -.category10-1-span { - background-color: #1f77b4; -} -.category10-2-span { - background-color: #ff7f0e; -} -.category10-3-span { - background-color: #2ca02c; -} -.category10-4-span { - background-color: #d62728; -} -.category10-5-span { - background-color: #9467bd; -} -.category10-6-span { - background-color: #8c564b; -} -.category10-7-span { - background-color: #e377c2; -} -.category10-8-span { - background-color: #7f7f7f; -} -.category10-9-span { - background-color: #bcdb22; -} -.category10-10-span { - background-color: #17becf; -} - -/* D3: category20 */ -.category20-1-span { - background-color: #1f77b4; -} -.category20-2-span { - background-color: #aec7e8; -} -.category20-3-span { - background-color: #ff7f0e; -} -.category20-4-span { - background-color: #ffbb78; -} -.category20-5-span { - background-color: #2ca02c; -} -.category20-6-span { - background-color: #98df8a; -} -.category20-7-span { - background-color: #d62728; -} -.category20-8-span { - background-color: #ff9896; -} -.category20-9-span { - background-color: #9467bd; -} -.category20-10-span { - background-color: #c5b0d5; -} -.category20-11-span { - background-color: #8c564b; -} -.category20-12-span { - background-color: #c49c94; -} -.category20-13-span { - background-color: #e377c2; -} -.category20-14-span { - background-color: #f7b6d2; -} -.category20-15-span { - background-color: #7f7f7f; -} -.category20-16-span { - background-color: #c7c7c7; -} -.category20-17-span { - background-color: #bcbd22; -} -.category20-18-span { - background-color: #dbdb8d; -} -.category20-19-span { - background-color: #17becf; -} -.category20-20-span { - background-color: #9edae5; -} - -/* D3: category20b */ -.category20b-1-span { - background-color: #393b79; -} -.category20b-2-span { - background-color: #5254a3; -} -.category20b-3-span { - background-color: #6b6ecf; -} -.category20b-4-span { - background-color: #9c9ede; -} -.category20b-5-span { - background-color: #637939; -} -.category20b-6-span { - background-color: #8ca252; -} -.category20b-7-span { - background-color: #b5cf6b; -} -.category20b-8-span { - background-color: #cedb9c; -} -.category20b-9-span { - background-color: #8c6d31; -} -.category20b-10-span { - background-color: #bd9e39; -} -.category20b-11-span { - background-color: #e7ba52; -} -.category20b-12-span { - background-color: #e7cb94; -} -.category20b-13-span { - background-color: #843c39; -} -.category20b-14-span { - background-color: #ad494a; -} -.category20b-15-span { - background-color: #d6616b; -} -.category20b-16-span { - background-color: #e7969c; -} -.category20b-17-span { - background-color: #7b4173; -} -.category20b-18-span { - background-color: #a55194; -} -.category20b-19-span { - background-color: #ce6dbd; -} -.category20b-20-span { - background-color: #de9ed6; -} - -/* D3: category20c */ -.category20c-1-span { - background-color: #3182bd; -} -.category20c-2-span { - background-color: #6baed6; -} -.category20c-3-span { - background-color: #9ecae1; -} -.category20c-4-span { - background-color: #c6dbef; -} -.category20c-5-span { - background-color: #e6550d; -} -.category20c-6-span { - background-color: #fd8d3c; -} -.category20c-7-span { - background-color: #fdae6b; -} -.category20c-8-span { - background-color: #fdd0a2; -} -.category20c-9-span { - background-color: #31a354; -} -.category20c-10-span { - background-color: #74c476; -} -.category20c-11-span { - background-color: #a1d99b; -} -.category20c-12-span { - background-color: #c7e9c0; -} -.category20c-13-span { - background-color: #756bb1; -} -.category20c-14-span { - background-color: #9e9ac8; -} -.category20c-15-span { - background-color: #bcbddc; -} -.category20c-16-span { - background-color: #dadaeb; -} -.category20c-17-span { - background-color: #636363; -} -.category20c-18-span { - background-color: #969696; -} -.category20c-19-span { - background-color: #bdbdbd; -} -.category20c-20-span { - background-color: #d9d9d9; -} diff --git a/ctor/lib/view/electron/css/reset.css b/ctor/lib/view/electron/css/reset.css deleted file mode 100644 index 753131e..0000000 --- a/ctor/lib/view/electron/css/reset.css +++ /dev/null @@ -1,66 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} diff --git a/ctor/lib/view/electron/css/styles.css b/ctor/lib/view/electron/css/styles.css deleted file mode 100644 index ed86f1a..0000000 --- a/ctor/lib/view/electron/css/styles.css +++ /dev/null @@ -1,135 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -.canvas { - display: block; - margin: 0 auto; -} - -.graph .hidden { - opacity: 0; -} - -/*.annotation .marker { - cursor: pointer; - opacity: 0.2; - fill: #ff0000; - stroke: none; -} - -.annotation .vline { - stroke: #000; - stroke-opacity: 0.2; -}*/ - -.annotations .title { - display: block; - /*font-size: 2em;*/ - line-height: 2em; - padding: 0 10px; - /*background-color: #474747;*/ - /*color: #ffffff;*/ - font-size: 1.5em; - color: #474747; -} - -.legend { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 60px; -} - -.legend .entry { - cursor: pointer; - margin-bottom: 10px; -} - -.legend .symbol { - display: inline-block; - height: 4px; - width: 10px; - line-height: 0.3em; -} - -.legend .label { - margin-left: 10px; -} - -.legend .hidden { - opacity: 0.25; -} - -.noselect { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -/* http://css-tricks.com/guide-responsive-friendly-css-columns/ */ -.multicolumn-1 { - -webkit-column-count: 1; - -moz-column-count: 1; - -ms-column-count: 1; - column-count: 1; - - -webkit-column-width: 150px; - -moz-column-width: 150px; - -ms-column-width: 150px; - column-width: 150px; -} - -.multicolumn-2 { - -webkit-column-count: 2; - -moz-column-count: 2; - -ms-column-count: 2; - column-count: 2; - - -webkit-column-width: 150px; - -moz-column-width: 150px; - -ms-column-width: 150px; - column-width: 150px; -} - -.multicolumn-3 { - -webkit-column-count: 3; - -moz-column-count: 3; - -ms-column-count: 3; - column-count: 3; - - -webkit-column-width: 150px; - -moz-column-width: 150px; - -ms-column-width: 150px; - column-width: 150px; -} - -.multicolumn-4 { - -webkit-column-count: 4; - -moz-column-count: 4; - -ms-column-count: 4; - column-count: 4; - - -webkit-column-width: 150px; - -moz-column-width: 150px; - -ms-column-width: 150px; - column-width: 150px; -} diff --git a/ctor/lib/view/electron/index.html b/ctor/lib/view/electron/index.html deleted file mode 100644 index 76ba506..0000000 --- a/ctor/lib/view/electron/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -   - - - - - -
{{plot}}
- - - diff --git a/ctor/lib/view/electron/index.js b/ctor/lib/view/electron/index.js deleted file mode 100644 index c5cbd74..0000000 --- a/ctor/lib/view/electron/index.js +++ /dev/null @@ -1,149 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// TODO: refactor. Remove disposable server. Create a server in the electron process and have it serve assets from local directories. Should be similar to SimpleServer. - -// MODULES // - -var spawn = require( 'child_process' ).spawn; -var path = require( 'path' ); -var logger = require( 'debug' ); -var toHTML = require( 'vdom-to-html' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var ENV = require( '@stdlib/process/env' ); -var copy = require( '@stdlib/utils/copy' ); -var merge = require( '@stdlib/utils/merge' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var httpServer = require( '@stdlib/net/disposable-http-server' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var debug = logger( 'plot:view:electron:main' ); -var electron = tryRequire( '@stdlib/electron' ); - - -// MAIN // - -/** -* Opens a plot in an electron window. -* -* @private -* @param {Plot} plot - plot context -* @param {VTree} vtree - virtual tree -* @throws {Error} Electron must be properly installed -*/ -function view( plot, vtree ) { - var index; - var html; - var opts; - var css; - - if ( instanceOf( electron, Error ) ) { - throw new Error( 'invalid operation. Unable to load Electron. Ensure Electron is installed and try again.' ); - } - debug( 'Transforming virtual DOM tree to HTML...' ); - html = toHTML( vtree ); - - // Define `fs` options: - opts = { - 'encoding': 'utf8' - }; - - debug( 'Injecting HTML into HTML template...' ); - index = path.join( __dirname, 'index.html' ); - index = readFileSync( index, opts ); - index = index.replace( /\{\{plot\}\}/, html ); - - debug( 'Injecting CSS into HTML template...' ); - css = path.join( __dirname, 'css', 'reset.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{reset\}\}/, css ); - - css = path.join( __dirname, 'css', 'colors.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{colors\}\}/, css ); - - css = path.join( __dirname, 'css', 'styles.css' ); - css = readFileSync( css, opts ); - index = index.replace( /\{\{styles\}\}/, css ); - - debug( 'Creating a disposable HTTP server...' ); - opts = { - 'html': index, - 'open': false - }; - httpServer( opts, onReady ); - - /** - * Callback invoked once a server is ready to receive requests. - * - * @private - * @param {(Error|null)} error - error object - * @param {Server} server - HTTP server - * @throws {Error} unexpected error - */ - function onReady( error, server ) { - var child; - var addr; - var opts; - var env; - if ( error ) { - throw error; - } - addr = server.address(); - debug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port ); - - debug( 'Electron executable: %s.', electron ); - - // TODO: extract fixed env vars to config file and then won't need to pass via environment variables, but can simply require - env = { - 'SERVER_PORT': addr.port, - 'SERVER_ADDRESS': addr.address, - 'PLOT_WIDTH': plot.width, - 'PLOT_HEIGHT': plot.height, - 'PLOT_APP_PATH': __dirname, - 'PLOT_MIN_WIDTH': 100, - 'PLOT_MIN_HEIGHT': 100, - 'PLOT_TITLE': plot.title || 'stdlib' - }; - debug( 'Electron process environment variables: %s.', JSON.stringify( env ) ); - - opts = { - 'cwd': __dirname, - 'detached': true, - 'stdio': 'ignore' - }; - debug( 'Electron process options: %s.', JSON.stringify( opts ) ); - - // Merge the current process' environment variables: - opts.env = merge( {}, copy( ENV ), env ); - - debug( 'Spawning an electron process...' ); - child = spawn( electron, [ './main.js' ], opts ); - child.unref(); - } -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/lib/view/electron/js/debug.js b/ctor/lib/view/electron/js/debug.js deleted file mode 100644 index d736a98..0000000 --- a/ctor/lib/view/electron/js/debug.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 ENV = require( '@stdlib/process/env' ); - - -// MAIN // - -var debug; - -// Setting the local storage variable must be done BEFORE loading `debug`: -localStorage.debug = ENV.DEBUG; - -// Load `debug`: -debug = require( 'debug/browser' ); // eslint-disable-line stdlib/require-order - - -// EXPORTS // - -module.exports = debug; diff --git a/ctor/lib/view/electron/js/script.js b/ctor/lib/view/electron/js/script.js deleted file mode 100644 index 7c01458..0000000 --- a/ctor/lib/view/electron/js/script.js +++ /dev/null @@ -1,80 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 path = require( 'path' ); -var readDir = require( '@stdlib/fs/read-dir' ); -var extname = require( '@stdlib/utils/extname' ); -var ENV = require( '@stdlib/process/env' ); -var logger = require( './debug.js' ); - - -// VARIABLES // - -var DIR = path.join( ENV.PLOT_APP_PATH, 'css' ); -var debug = logger( 'plot:view:electron:script' ); - - -// FUNCTIONS // - -/** -* Inserts stylesheets. -* -* @private -*/ -function stylesheets() { - var files; - var link; - var i; - - debug( 'Stylesheet directory: %s.', DIR ); - files = readDir.sync( DIR ); - for ( i = 0; i < files.length; i++ ) { - if ( extname( files[i] ) !== '.css' ) { - continue; - } - debug( 'Found a CSS file: %s.', files[i] ); - - debug( 'Generating link element...' ); - link = document.createElement( 'link' ); - link.setAttribute( 'rel', 'stylesheet' ); - link.setAttribute( 'href', path.join( DIR, files[i] ) ); - - debug( 'Appending link element to the document head...' ); - document.head.appendChild( link ); - } -} - - -// MAIN // - -/** -* Main script. -* -* @private -*/ -function main() { - debug( 'Injecting stylesheets into the document...' ); - stylesheets(); -} - -debug( 'Running main script...' ); -main(); diff --git a/ctor/lib/view/electron/main.js b/ctor/lib/view/electron/main.js deleted file mode 100644 index 657b144..0000000 --- a/ctor/lib/view/electron/main.js +++ /dev/null @@ -1,103 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var app = require( 'electron' ).app; -var BrowserWindow = require( 'electron' ).BrowserWindow; -var ENV = require( '@stdlib/process/env' ); - - -// VARIABLES // - -var debug = logger( 'plot:view:electron:main-process' ); -var mainWindow = null; - - -// FUNCTIONS // - -/** -* Creates a browser window. -* -* @private -*/ -function createWindow() { - var opts; - var url; - - opts = { - 'width': parseInt( ENV.PLOT_WIDTH, 10 ) + 80, - 'height': parseInt( ENV.PLOT_HEIGHT, 10 ) + 20, - 'title': ENV.PLOT_TITLE, - - // 'minWidth': parseInt( ENV.PLOT_MIN_WIDTH, 10 ), // TODO: needed? - - // 'minHeight': parseInt( ENV.PLOT_MIN_HEIGHT, 10 ), // TODO: needed? - - // 'titleBarStyle': 'hidden-inset', // hide title bar on OS X - - 'useContentSize': true // specify web page size only considering the content - }; - debug( 'Creating a new browser window configured with the following options: %s.', JSON.stringify( opts ) ); - mainWindow = new BrowserWindow( opts ); - - mainWindow.on( 'close', onClose ); - - url = 'http://'+ENV.SERVER_ADDRESS+':'+ENV.SERVER_PORT+'/index.html'; - debug( 'Loading %s.', url ); - mainWindow.loadURL( url ); -} - -/** -* Callback invoked once a window closes. -* -* @private -*/ -function onClose() { - debug( 'Window closed. Dereferencing window object to allow for GC...' ); - mainWindow = null; -} - -/** -* Quits the application. -* -* @private -*/ -function quit() { - debug( 'Quitting application...' ); - app.quit(); -} - - -// MAIN // - -/** -* Runs the application. -* -* @private -*/ -function main() { - app.on( 'ready', createWindow ); - app.on( 'window-all-closed', quit ); -} - -debug( 'Running application...' ); -main(); diff --git a/ctor/lib/view/index.js b/ctor/lib/view/index.js deleted file mode 100644 index 3bb8988..0000000 --- a/ctor/lib/view/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var _view = require( './view.js' ); // eslint-disable-line no-underscore-dangle - - -// VARIABLES // - -var debug = logger( 'plot:view' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {string} viewer - plot viewer -*/ -function view( viewer ) { - /* eslint-disable no-invalid-this */ - var tmp = this.viewer; - if ( arguments.length ) { - // Temporarily set the viewer: - this.viewer = viewer; - } - debug( 'Viewer: %s.', this.viewer ); - debug( 'Generating view...' ); - _view( this, this.viewer, this.render() ); - if ( arguments.length ) { - // Restore the viewer: - this.viewer = tmp; - } -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/lib/view/stdout/index.js b/ctor/lib/view/stdout/index.js deleted file mode 100644 index be39926..0000000 --- a/ctor/lib/view/stdout/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Writes a plot (rendered as a virtual DOM tree) to `stdout`. -* -* @private -* @param {VTree} plot - virtual tree -*/ -function view( plot ) { - console.log( JSON.stringify( plot ) ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/lib/view/view.browser.js b/ctor/lib/view/view.browser.js deleted file mode 100644 index 91e2b35..0000000 --- a/ctor/lib/view/view.browser.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 stdout = require( './stdout' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {Plot} plot - plot context -* @param {string} viewer - plot viewer -* @param {VTree} vtree - virtual tree -* @throws {Error} must specify a supported viewer -* @returns {void} -*/ -function view( plot, viewer, vtree ) { - if ( viewer === 'none' ) { - return; - } - if ( viewer === 'stdout' ) { - return stdout( vtree ); - } - if ( viewer === 'browser' ) { - throw new Error( format( 'invalid argument. Must provide a supported viewer. Value: `%s`.', viewer ) ); - } - if ( viewer === 'terminal' ) { - // TODO: ASCII - return; - } - throw new Error( format( 'invalid argument. Must provide a supported viewer. Value: `%s`.', viewer ) ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/lib/view/view.js b/ctor/lib/view/view.js deleted file mode 100644 index 362970e..0000000 --- a/ctor/lib/view/view.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 stdout = require( './stdout' ); -var browser = require( './browser' ); -var electron = require( './electron' ); - - -// MAIN // - -/** -* Generates a plot view. -* -* @private -* @param {Plot} plot - plot context -* @param {string} viewer - plot viewer -* @param {VTree} vtree - virtual -* @returns {void} -*/ -function view( plot, viewer, vtree ) { - if ( viewer === 'none' ) { - return; - } - if ( viewer === 'stdout' ) { - return stdout( vtree ); - } - if ( viewer === 'browser' ) { - return browser( vtree ); - } - if ( viewer === 'terminal' ) { - // TODO: ASCII - return; - } - // viewer === 'window' - electron( plot, vtree ); -} - - -// EXPORTS // - -module.exports = view; diff --git a/ctor/package.json b/ctor/package.json deleted file mode 100644 index 64850cb..0000000 --- a/ctor/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/plot/ctor", - "version": "0.0.0", - "description": "2-dimensional plot 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", - "browser": { - "./lib/view/view.js": "./lib/view/view.browser.js" - }, - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "constructor", - "ctor", - "figure", - "fig", - "graph", - "chart", - "diagram", - "2-dimensional", - "2d", - "data", - "visualize", - "visualization", - "dataviz", - "explore", - "exploratory", - "analysis" - ] -} diff --git a/ctor/srv/scripts/fig_intro_plot.js b/ctor/srv/scripts/fig_intro_plot.js deleted file mode 100644 index 5136cf6..0000000 --- a/ctor/srv/scripts/fig_intro_plot.js +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Plot = require( './../../../ctor' ); - - -// MAIN // - -/** -* Generates a plot. -* -* @private -*/ -function main() { - var html; - var plot; - var opts; - var x1; - var x2; - var y1; - var y2; - var i; - - // Create some data... - x1 = new Float64Array( 1000 ); - x2 = new Float64Array( x1.length ); - y1 = new Float64Array( x1.length ); - y2 = new Float32Array( x1.length ); - for ( i = 0; i < x1.length; i++ ) { - x1[ i ] = 30.0 + (7.5*randn()); - x2[ i ] = 40.0 + (12.5*randn()); - y1[ i ] = 50.0 + (10.0*randn()); - y2[ i ] = 30.0 + (5.0*randn()); - } - - // Define the plot options: - opts = { - 'width': 600, - 'height': 480, - 'xMin': 0.0, - 'xMax': 100.0, - 'yMin': 0.0, - 'yMax': 100.0, - 'lineStyle': 'none', - 'symbols': 'closed-circle', - 'symbolsSize': 6, - 'symbolsOpacity': 0.2, - 'xRug': true, - 'yRug': true, - 'xRugOrient': 'top', - 'yRugOrient': 'right' - }; - - // Create a new plot: - plot = new Plot( [ x1, x2 ], [ y1, y2 ], opts ); - - // Render as HTML/SVG: - html = plot.render( 'html' ); - - // Write to `stdout`: - console.log( html ); -} - -main(); diff --git a/ctor/test/test.js b/ctor/test/test.js deleted file mode 100644 index 2502f0e..0000000 --- a/ctor/test/test.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var plot = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.equal( typeof plot, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to main export is a factory method for creating reusable plot generation functions', function test( t ) { - t.equal( typeof plot.factory, 'function', 'export has factory method' ); - t.end(); -}); diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index 3308943..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,452 +0,0 @@ - -{{alias}}( [x, y,] [options] ) - Returns a plot instance for creating 2-dimensional plots. - - `x` and `y` arguments take precedence over `x` and `y` options. - - Parameters - ---------- - x: Array|Array (optional) - An array of arrays containing x-coordinate values. - - y: Array|Array (optional) - An array of arrays containing y-coordinate values. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.autoView: boolean (optional) - Boolean indicating whether to generate an updated view on a 'render' - event. Default: false. - - options.colors: string|Array (optional) - Data color(s). Default: 'category10'. - - options.description: string (optional) - Plot description. - - options.engine: string (optional) - Plot engine. Default: 'svg'. - - options.height: number (optional) - Plot height (in pixels). Default: 400. - - options.labels: Array|Array (optional) - Data labels. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.lineStyle: string|Array (optional) - Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'. - Default: '-'. - - options.lineOpacity: number|Array (optional) - Data line opacity. Must be on the interval [0,1]. Default: 0.9. - - options.lineWidth: integer|Array (optional) - Data line width (in pixels). Default: 2. - - options.paddingBottom: integer (optional) - Bottom padding (in pixels). Default: 80. - - options.paddingLeft: integer (optional) - Left padding (in pixels). Default: 90. - - options.paddingRight: integer (optional) - Right padding (in pixels). Default: 20. - - options.paddingTop: integer (optional) - Top padding (in pixels). Default: 80. - - options.renderFormat: string (optional) - Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'. - - options.symbols: string|Array (optional) - Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'. - Default: 'none'. - - options.symbolsOpacity: number|Array (optional) - Symbols opacity. Must be on the interval [0,1]. Default: 0.9. - - options.symbolsSize: integer|Array (optional) - Symbols size (in pixels). Default: 6. - - options.title: string (optional) - Plot title. - - options.viewer: string (optional) - Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window', - or 'none'. Default: 'none'. - - options.width: number (optional) - Plot width (in pixels). Default: 400. - - options.x: Array|Array (optional) - x-coordinate values. - - options.xAxisOrient: string (optional) - x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'. - - options.xLabel: string (optional) - x-axis label. Default: 'x'. - - options.xMax: number|null (optional) - Maximum value of the x-axis domain. If `null`, the maximum value is - calculated from the data. Default: null. - - options.xMin: number|null (optional) - Minimum value of the x-axis domain. If `null`, the minimum value is - calculated from the data. Default: null. - - options.xNumTicks: integer (optional) - Number of x-axis tick marks. Default: 5. - - options.xRug: boolean|Array (optional) - Boolean flag(s) indicating whether to render one or more rug plots along - the x-axis. - - options.xRugOrient: string|Array (optional) - x-axis rug plot orientation(s). Must be either 'bottom' or 'top'. - Default: 'bottom'. - - options.xRugOpacity: number|Array (optional) - x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1. - - options.xRugSize: integer|Array (optional) - x-axis rug tick (tassel) size (in pixels). Default: 6. - - options.xScale: string - x-axis scale. Default: 'linear'. - - options.xTickFormat: string|null - x-axis tick format. Default: null. - - options.y: Array|Array (optional) - y-coordinate values. - - options.yAxisOrient: string (optional) - x-axis orientation. Must be either 'left' or 'right'. Default: 'left'. - - options.yLabel: string (optional) - y-axis label. Default: 'y'. - - options.yMax: number|null (optional) - Maximum value of the y-axis domain. If `null`, the maximum value is - calculated from the data. Default: null. - - options.yMin: number|null (optional) - Minimum value of the y-axis domain. If `null`, the minimum value is - calculated from the data. Default: null. - - options.yNumTicks: integer (optional) - Number of x-axis tick marks. Default: 5. - - options.yRug: boolean|Array (optional) - Boolean flag(s) indicating whether to render one or more rug plots along - the y-axis. - - options.yRugOrient: string|Array (optional) - y-axis rug plot orientation(s). Must be either 'left' or 'right'. - Default: 'left'. - - options.yRugOpacity: number|Array (optional) - y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1. - - options.yRugSize: integer|Array (optional) - y-axis rug tick (tassel) size (in pixels). Default: 6. - - options.yScale: string - y-axis scale. Default: 'linear'. - - options.yTickFormat: string|null - y-axis tick format. Default: null. - - Returns - ------- - plot: Plot - Plot instance. - - plot.render() - Renders a plot as a virtual DOM tree. - - plot.view( [viewer] ) - Generates a plot view. - - plot.x - x-coordinate values. An assigned value must be an array where each - element corresponds to a plotted dataset. - - plot.y - y-coordinate values. An assigned value must be an array, where each - element corresponds to a plotted dataset. - - plot.labels - Data labels. During plot creation, each plotted dataset is assigned a - label. If the number of labels is less than the number of plotted - datasets, labels are reused using modulo arithmetic. - - plot.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - plot.colors - Data colors. To set the color all plotted datasets, provide a color - name. To specify the colors for each dataset, provide an array of - colors. During plot creation, each plotted dataset is assigned one of - the provided colors. If the number of colors is less than the number of - plotted datasets, colors are reused using modulo arithmetic. Lastly, - colors may also be specified by providing the name of a predefined color - scheme. The following schemes are supported: 'category10', 'category20', - 'category20b', and 'category20c'. - - plot.lineStyle - Data line style(s). The following line styles are supported: '-' (solid - line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes - and dots), and 'none' (no line). To specify the line style for each - dataset, provide an array of line styles. During plot creation, each - plotted dataset is assigned a line style. If the number of line styles - is less than the number of plotted datasets, line styles are reused - using modulo arithmetic. - - plot.lineOpacity - Data line opacity, where an opacity of `0.0` make a line completely - transparent and an opacity of `1.0` makes a line completely opaque. To - specify the line opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.lineWidth - Data line width(s). To specify the line width for each dataset, provide - an array of widths. During plot creation, each plotted dataset is - assigned a line width. If the number of line widths is less than the - number of plotted datasets, line widths are reused using modulo - arithmetic. - - plot.symbols - Data symbols. The following symbols are supported: 'closed-circle' - (closed circles), 'open-circle' (open circles), and 'none' (no symbols). - To specify the symbols used for each dataset, provide an array of - symbols. During plot creation, each plotted dataset is assigned a - symbol. If the number of symbols is less than the number of plotted - datasets, symbols are reused using modulo arithmetic. - - plot.symbolSize - Symbols size. To specify the symbols size for each dataset, provide an - array of sizes. During plot creation, each plotted dataset is assigned - a symbols size. If the number of sizes is less than the number of - plotted datasets, sizes are reused using modulo arithmetic. - - plot.symbolsOpacity - Symbols opacity, where an opacity of `0.0` makes a symbol completely - transparent and an opacity of `1.0` makes a symbol completely opaque. To - specify the opacity for each dataset, provide an array of opacities. - During plot creation, each plotted dataset is assigned an opacity. If - the number of opacities is less than the number of plotted datasets, - opacities are reused using modulo arithmetic. - - plot.width - Plot width (in pixels). - - plot.height - Plot height (in pixels). - - plot.paddingLeft - Plot left padding (in pixels). Left padding is typically used to create - space for a left-oriented y-axis. - - plot.paddingRight - Plot right padding (in pixels). Right padding is typically used to - create space for a right-oriented y-axis. - - plot.paddingTop - Plot top padding (in pixels). Top padding is typically used to create - space for a title or top-oriented x-axis. - - plot.paddingBottom - Plot bottom padding (in pixels). Bottom padding is typically used to - create space for a bottom-oriented x-axis. - - plot.xMin - Minimum value of the x-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `x` data. - - plot.xMax - Maximum value of the x-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `x` data. - - plot.yMin - Minimum value of the y-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `y` data. - - plot.yMax - Maximum value of the y-axis domain. When retrieved, if the value has - been set to `null`, the returned value is computed from the `y` data. - - plot.xScale - Scale function for mapping values to a coordinate along the x-axis. The - following `scales` are supported: 'linear' (linear scale) and 'time' - (time scale). When retrieved, the returned value is a scale function. - - plot.yScale - Scale function for mapping values to a coordinate along the y-axis. The - following `scales` are supported: 'linear' (linear scale) and 'time' - (time scale). When retrieved, the returned value is a scale function. - - plot.xTickFormat - x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not - been set to `null`, the returned value is a formatting function. - - plot.yTickFormat - y-axis tick format (e.g., '%%'). When retrieved, if the value has not - been set to `null`, the returned value is a formatting function. - - plot.xNumTicks - Number of x-axis tick marks. If the value is set to `null`, the number - of tick marks is computed internally. - - plot.yNumTicks - Number of y-axis tick marks. If the value is set to `null`, the number - of tick marks is computed internally. - - plot.xAxisOrient - x-axis orientation. The following orientations are supported: 'bottom' - and 'top'. - - plot.yAxisOrient - y-axis orientation. The following orientations are supported: 'left' and - 'right'. - - plot.xRug - Boolean flag(s) indicating whether to display a rug plot along the x- - axis. To specify the flag for each dataset, provide an array of - booleans. During plot creation, each plotted dataset is assigned a flag. - If the number of flags is less than the number of plotted datasets, - flags are reused using modulo arithmetic. - - plot.yRug - Boolean flag(s) indicating whether to display a rug plot along the y- - axis. To specify the flag for each dataset, provide an array of - booleans. During plot creation, each plotted dataset is assigned a flag. - If the number of flags is less than the number of plotted datasets, - flags are reused using modulo arithmetic. - - plot.xRugOrient - x-axis rug orientation. The following orientations are supported: - 'bottom' or 'top'. To specify the x-axis rug orientation for each - dataset, provide an array of orientations. During plot creation, each - plotted dataset is assigned an orientation. If the number of - orientations is less than the number of plotted datasets, orientations - are reused using modulo arithmetic. - - plot.yRugOrient - y-axis rug orientation. The following orientations are supported: 'left' - or 'right'. To specify the y-axis rug orientation for each dataset, - provide an array of orientations. During plot creation, each plotted - dataset is assigned an orientation. If the number of orientations is - less than the number of plotted datasets, orientations are reused using - modulo arithmetic. - - plot.xRugOpacity - x-axis rug opacity, where an opacity of `0.0` makes a rug completely - transparent and an opacity of `1.0` makes a rug completely opaque. To - specify the x-axis rug opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.yRugOpacity - y-axis rug opacity, where an opacity of `0.0` makes a rug completely - transparent and an opacity of `1.0` makes a rug completely opaque. To - specify the y-axis rug opacity for each dataset, provide an array of - opacities. During plot creation, each plotted dataset is assigned an - opacity. If the number of opacities is less than the number of plotted - datasets, opacities are reused using modulo arithmetic. - - plot.xRugSize - x-axis rug tick (tassel) size. To specify the x-axis rug size for each - dataset, provide an array of sizes. During plot creation, each plotted - dataset is assigned a tick size. If the number of sizes is less than the - number of plotted datasets, sizes are reused using modulo arithmetic. - - plot.yRugSize - y-axis rug tick (tassel) size. To specify the y-axis rug size for each - dataset, provide an array of sizes. During plot creation, each plotted - dataset is assigned a tick size. If the number of sizes is less than the - number of plotted datasets, sizes are reused using modulo arithmetic. - - plot.description - Plot description. - - plot.title - Plot title. - - plot.xLabel - x-axis label. - - plot.yLabel - y-axis label. - - plot.engine - Plot rendering engine. The following engines are supported: 'svg'. - - plot.renderFormat - Plot render format. The following formats are supported: 'vdom' and - 'html'. - - plot.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - plot.viewer - Plot viewer. The following viewers are supported: 'none', 'stdout', - 'window', and 'browser'. - - plot.autoView - Viewer mode. If `true`, an instance generates an updated view on each - 'render' event; otherwise, generating a view must be triggered manually. - - plot.graphWidth - Computed property corresponding to the expected graph width. - - plot.graphHeight - Computed property corresponding to the expected graph height. - - plot.xDomain - Computed property corresponding to the x-axis domain. - - plot.yDomain - Computed property corresponding to the y-axis domain. - - plot.xRange - Computed property corresponding to the x-axis range. - - plot.yRange - Computed property correspond to the y-axis range. - - plot.xPos - A function which maps values to x-axis coordinate values. - - plot.yPos - A function which maps values to y-axis coordinate values. - - Examples - -------- - > var plot = {{alias}}() - - - // Provide plot data at instantiation: - > var x = [[0.10, 0.20, 0.30]]; - > var y = [[0.52, 0.79, 0.64]]; - > plot = {{alias}}( x, y ) - - - See Also - -------- - diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0ca7ba5..0000000 --- a/examples/index.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var now = require( '@stdlib/time/now' ); -var plot = require( './../lib' ); - -var t; -var x; -var y; -var i; - -// Create some data... -t = now() * 1000; -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = t + (i*360000); - y[ i ] = 50.0 + (10.0*randn()); -} - -// Create a new plot: -var plt = plot( [x], [y], { - 'width': 600, - 'height': 480, - 'xScale': 'time', - 'xTickFormat': '%H:%M', - 'renderFormat': 'html' -}); - -// Render as a virtual DOM tree: -var vtree = plt.render( 'vdom' ); -console.log( JSON.stringify( vtree ) ); - -// Render as HTML: -var html = plt.render(); -console.log( html ); - -// Listen for 'render' events (e.g., when triggered due to changes in state): -plt.on( 'render', onRender ); - -setTimeout( update, 1000 ); - -function update() { - plt.width = 720; -} - -function onRender( html ) { - console.log( html ); -} diff --git a/hist/lib/accessors/is_defined.js b/hist/lib/accessors/is_defined.js deleted file mode 100644 index d7a1a28..0000000 --- a/hist/lib/accessors/is_defined.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'hist:accessor:is-defined' ); - - -// MAIN // - -/** -* Accessor function which determines whether a datum is defined. -* -* @private -* @param {number} d - datum -* @param {integer} i - index -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/hist/lib/defaults.js b/hist/lib/defaults.js deleted file mode 100644 index 0b56c06..0000000 --- a/hist/lib/defaults.js +++ /dev/null @@ -1,179 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isNodeREPL = require( '@stdlib/assert/is-node-repl' ); -var isDefined = require( './accessors/is_defined.js' ); - - -// MAIN // - -/** -* Returns default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var isREPL; - var o; - - isREPL = isNodeREPL(); - o = {}; - - // Boolean indicating whether to re-render on a change event: - o.autoRender = false; - - // Boolean indicating whether to generate an updated view on a render event: - o.autoView = false; - - // Bar face colors: - o.barColors = 'category10'; - - // Bar face opacity: - o.barOpacity = 0.9; // [0,1] - - // Binning algorithm: - o.binMethod = null; - - // Bins and/or number of bins: - o.bins = []; - - // Bin width: - o.binWidth = null; - - // Histogram description: - o.description = ''; - - // Maximum bin edge: - o.edgeMax = null; - - // Minimum bin edge: - o.edgeMin = null; - - // Bin edges: - o.edges = []; - - // Rendering engine: - o.engine = 'svg'; - - // Histogram height: - o.height = 400; // px - - // Accessor indicating whether a datum is defined: - o.isDefined = isDefined; - - // Data labels: - o.labels = []; - - // Line color: - o.lineColors = '#000000'; - - // Line opacity: - o.lineOpacity = 0.9; // [0,1] - - // Line style: - o.lineStyle = '-'; - - // Data line width(s): - o.lineWidth = 2; // px - - // Histogram normalization: - o.normalization = 'count'; - - // Histogram orientation: - o.orientation = 'vertical'; - - // FIXME: padding props depend on orientation (may require using `null` to flag) - - // Bottom padding: - o.paddingBottom = 80; // px - - // Left padding: - o.paddingLeft = 90; // px - - // Right padding: - o.paddingRight = 20; // px - - // Top padding: - o.paddingTop = 80; // px - - // Render format: - o.renderFormat = 'vdom'; - - // Histgram title: - o.title = ''; - - // Histogram viewer: - if ( isREPL ) { - o.viewer = 'window'; - } else { - o.viewer = 'none'; - } - // Histogram width: - o.width = 400; // px - - // Values to bin: - o.x = []; - - // x-axis orientation: - o.xAxisOrient = 'bottom'; - - // x-axis label: - o.xLabel = 'x'; - - // Maximum value of x-axis domain: - o.xMax = null; - - // Minimum value of x-axis domain: - o.xMin = null; - - // Number of x-axis tick marks: - o.xNumTicks = 5; - - // x-axis tick format: - o.xTickFormat = null; - - // y-axis orientation: - o.yAxisOrient = 'left'; - - // y-axis label: - o.yLabel = 'y'; - - // Maximum value of y-axis domain: - o.yMax = null; - - // Minimum value of y-axis domain: - o.yMin = null; - - // Number of y-axis tick marks: - o.yNumTicks = 5; - - // y-axis tick format: - o.yTickFormat = null; - - return o; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/hist/lib/index.js b/hist/lib/index.js deleted file mode 100644 index 3ea58a7..0000000 --- a/hist/lib/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a 1-dimensional histogram. -* -* @module @stdlib/plot/hist -* -* @example -* var Histogram = require( '@stdlib/plot/hist' ); -* -* var hist = new Histogram(); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/hist/lib/main.js b/hist/lib/main.js deleted file mode 100644 index 15e86f5..0000000 --- a/hist/lib/main.js +++ /dev/null @@ -1,289 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var inherit = require( '@stdlib/utils/inherit' ); -var format = require( '@stdlib/string/format' ); -var copy = require( '@stdlib/utils/copy' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var defineProperty = require( '@stdlib/utils/define-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var Plot = require( './../../base/ctor' ); -var defaults = require( './defaults.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setYLabel = require( './props/y-label/set.js' ); -var getYLabel = require( './props/y-label/get.js' ); -var render = require( './render' ); - - -// VARIABLES // - -var debug = logger( 'hist:main' ); -var PRIVATE_PROPS = [ - '_barColors', - '_barOpacity', - '_binCounts', - '_binMethod', - '_binWidth', - '_edgeMax', - '_edgeMin', - '_edges', - '_lineColors', - '_nbins', - '_normalization', - '_orientation', - '_xData', - '_xMax', - '_xMin', - '_xScale', - '_yData', - '_yLabel', - '_yMax', - '_yMin', - '_yScale' -]; - - -// FUNCTIONS // - -var merge = mergeFcn({ - 'extend': false -}); - - -// MAIN // - -/** -* Histogram constructor. -* -* @constructor -* @param {Array} [x] - values to bin -* @param {Array} [bins] - edges and/or number of bins -* @param {Options} [options] - constructor options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event -* @param {boolean} [options.autoView=false] - indicates whether to generate an updated view on a render event -* @param {(string|StringArray)} [options.barColors='category10'] - bar face color(s) -* @param {(number|NumberArray)} [options.barOpacity=0.9] - bar face opacity -* @param {(null|string|Array)} [options.binMethod=null] - binning algorithm -* @param {Array} [options.bins=[]] - edges and/or number of bins -* @param {(null|number|NumberArray)} [options.binWidth=null] - bin width -* @param {string} [options.description=''] - description -* @param {(null|number|Array)} [options.edgeMax=null] - maximum bin edge value -* @param {(null|number|Array)} [options.edgeMin=null] - minimum bin edge value -* @param {Array} [options.edges] - bin edges -* @param {string} [options.engine='svg'] - render engine -* @param {PositiveNumber} [options.height=400] - plot height -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {(StringArray|EmptyArray)} [options.labels] - data labels -* @param {(string|StringArray)} [options.lineColors='#000'] - line color(s) -* @param {(number|NumberArray)} [options.lineOpacity=0.9] - line opacity -* @param {(string|StringArray)} [options.lineStyle='-'] - line style(s) -* @param {(NonNegativeInteger|Array)} [options.lineWidth=2] - line width(s) -* @param {(null|number|Array)} [options.nbins] - number of bins -* @param {(string|StringArray)} [options.normalization='count'] - histogram normalization -* @param {string} [options.orientation='vertical'] - histogram orientation -* @param {NonNegativeInteger} [options.paddingBottom=80] - bottom padding -* @param {NonNegativeInteger} [options.paddingLeft=90] - left padding -* @param {NonNegativeInteger} [options.paddingRight=20] - right padding -* @param {NonNegativeInteger} [options.paddingTop=80] - top padding -* @param {string} [options.renderFormat='vdom'] - render format -* @param {string} [options.title=''] - title -* @param {string} [options.viewer='none'] - viewer -* @param {PositiveNumber} [options.width=400] - plot width -* @param {Array} [options.x=[]] - values to bin -* @param {string} [options.xAxisOrient='bottom'] - x-axis orientation -* @param {string} [options.xLabel='x'] - x-axis label -* @param {(Date|FiniteNumber|null)} [options.xMax=null] - maximum value of x-axis domain -* @param {(Date|FiniteNumber|null)} [options.xMin=null] - minimum value of x-axis domain -* @param {(NonNegativeInteger|null)} [options.xNumTicks=5] - number of x-axis tick marks -* @param {(string|null)} [options.xTickFormat=null] - x-axis tick format -* @param {string} [options.yAxisOrient='left'] - y-axis orientation -* @param {(null|string)} [options.yLabel=null] - y-axis label -* @param {(FiniteNumber|null)} [options.yMax=null] - maximum value of y-axis domain -* @param {(FiniteNumber|null)} [options.yMin=null] - minimum value of y-axis domain -* @param {(NonNegativeInteger|null)} [options.yNumTicks=5] - number of y-axis tick marks -* @param {(string|null)} [options.yTickFormat=null] - y-axis tick format -* @throws {TypeError} must provide valid options -* @returns {Histogram} Histogram instance -* -* @example -* var hist = new Histogram(); -*/ -function Histogram() { - var options; - var nargs; - var keys; - var opts; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof Histogram) ) { - if ( nargs === 0 ) { - return new Histogram(); - } - if ( nargs === 1 ) { - return new Histogram( arguments[0] ); - } - if ( nargs === 2 ) { - return new Histogram( arguments[0], arguments[1] ); - } - return new Histogram( arguments[0], arguments[1], arguments[2] ); - } - opts = defaults(); - if ( nargs === 0 ) { - options = {}; - } else if ( nargs === 1 ) { - options = arguments[ 0 ]; - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - } else if ( nargs === 2 ) { - options = {}; - options.x = arguments[ 0 ]; - options.bins = arguments[ 1 ]; - } else if ( nargs > 2 ) { - if ( !isObject( arguments[ 2 ] ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', arguments[2] ) ); - } - options = copy( arguments[ 2 ] ); // avoid mutation - options.x = arguments[ 0 ]; - options.bins = arguments[ 1 ]; - } - opts = merge( opts, options ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - Plot.call( this, opts ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - return this; -} - -/* -* Inherit from the `Plot` prototype. -*/ -inherit( Histogram, Plot ); - -/** -* Accessor which defines whether a datum is defined. -* -* ## Notes -* -* - This accessor is used to define how missing values are encoded. -* - The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Histogram.prototype -* @type {Function} -* @param {*} d - datum -* @param {integer} i - index -* @throws {TypeError} must be a function -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* var hist = new Histogram(); -* hist.isDefined = isDefined; -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* var hist = new Histogram({ -* 'isDefined': isDefined -* }); -* var fcn = hist.isDefined; -* // returns -*/ -defineProperty( Histogram.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* y-axis label. -* -* @name yLabel -* @memberof Histogram.prototype -* @type {(string|null)} -* @throws {TypeError} must be a string or null -* @default null -* -* @example -* var hist = new Histogram(); -* hist.yLabel = 'value'; -* -* @example -* var hist = new Histogram({ -* 'yLabel': 'value' -* }); -* var yLabel = hist.yLabel; -* // returns 'value' -*/ -defineProperty( Histogram.prototype, 'yLabel', { - 'configurable': false, - 'enumerable': true, - 'set': setYLabel, - 'get': getYLabel -}); - -/** -* Renders a histogram. -* -* @private -* @name _render -* @memberof Histogram.prototype -* @type {Function} -* @param {string} format - render format -* @returns {(VTree|string)} rendered histogram -*/ -setReadOnly( Histogram.prototype, '_render', render ); - - -// EXPORTS // - -module.exports = Histogram; diff --git a/hist/lib/props/is-defined/get.js b/hist/lib/props/is-defined/get.js deleted file mode 100644 index fd05f22..0000000 --- a/hist/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the accessor for defined values. -* -* @private -* @returns {Function} accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/hist/lib/props/is-defined/set.js b/hist/lib/props/is-defined/set.js deleted file mode 100644 index 9ee18fa..0000000 --- a/hist/lib/props/is-defined/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'hist:set:is-defined' ); - - -// MAIN // - -/** -* Sets the accessor for defined values. -* -* @private -* @param {Function} fcn - accessor -* @throws {TypeError} must be a function -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - if ( fcn !== this._isDefined ) { - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/hist/lib/props/y-label/get.js b/hist/lib/props/y-label/get.js deleted file mode 100644 index 4b36a06..0000000 --- a/hist/lib/props/y-label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-axis label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._yLabel; -} - - -// EXPORTS // - -module.exports = get; diff --git a/hist/lib/props/y-label/set.js b/hist/lib/props/y-label/set.js deleted file mode 100644 index 6d66001..0000000 --- a/hist/lib/props/y-label/set.js +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'hist:set:y-label' ); -var LABELS = { - 'count': 'counts', - 'probability': 'probability', - 'countdensity': 'density', - 'pdf': 'pdf', - 'cumcount': 'counts', - 'cdf': 'cdf' -}; - - -// MAIN // - -/** -* Sets the y-axis label. -* -* @private -* @param {(string|null)} label - axis label -* @throws {TypeError} must be a string or null -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - var FLG = isNull( label ); - if ( !isString( label ) && !FLG ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string or null. Value: `%s`.', 'yLabel', label ) ); - } - if ( FLG ) { - label = LABELS[ this._normalization ]; - } - if ( label !== this._yLabel ) { - debug( 'Current value: %s.', this._yLabel ); - - this._yLabel = label; - debug( 'New value: %s.', this._yLabel ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/hist/lib/render/index.js b/hist/lib/render/index.js deleted file mode 100644 index e15299a..0000000 --- a/hist/lib/render/index.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var vdom2html = require( 'vdom-to-html' ); -var renderSVG = require( './svg' ); - - -// VARIABLES // - -var debug = logger( 'hist:render' ); - - -// MAIN // - -/** -* Renders a histogram. -* -* @private -* @param {string} format - render format -* @returns {(VTree|string)} virtual tree or a string -*/ -function render( format ) { - /* eslint-disable no-invalid-this */ - var out; - - debug( 'Render format: %s.', format ); - - debug( 'Rendering...' ); - if ( this._engine === 'svg' ) { - out = renderSVG( this ); - - // Default render format is virtual DOM... - if ( format === 'html' ) { - out = vdom2html( out ); - } - this.emit( 'render', out ); - } - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/hist/lib/render/svg/index.js b/hist/lib/render/svg/index.js deleted file mode 100644 index 0895b03..0000000 --- a/hist/lib/render/svg/index.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var xAxisTransform = require( './utils/x_axis_transform.js' ); -var yAxisTransform = require( './utils/y_axis_transform.js' ); -var renderMarks = require( './marks' ); -var init = require( './init.js' ); -var sync = require( './sync.js' ); - - -// VARIABLES // - -var debug = logger( 'hist:render:svg:main' ); - - -// MAIN // - -/** -* Renders a virtual DOM tree. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var annotations; - var clipPath; - var canvas; - var title; - var graph; - var marks; - var xAxis; - var yAxis; - var bkgd; - var defs; - var svg; - - svg = state.$.svg; - - // Lazily initialize... - if ( !svg.canvas ) { - debug( 'Initializing components...' ); - init( state ); - } - debug( 'Syncing component states...' ); - sync( state ); - - debug( 'Rendering individual components...' ); - - debug( 'Rendering annotations...' ); - annotations = svg.annotations.render(); - - debug( 'Rendering clip-path...' ); - clipPath = svg.clipPath.render(); - - debug( 'Rendering canvas...' ); - canvas = svg.canvas.render(); - - debug( 'Rendering graph...' ); - graph = svg.graph.render(); - - debug( 'Rendering title...' ); - title = svg.title.render(); - - debug( 'Rendering x-axis...' ); - xAxis = svg.xAxis.render(); - - debug( 'Rendering y-axis...' ); - yAxis = svg.yAxis.render(); - - debug( 'Rendering background...' ); - bkgd = svg.bkgd.render(); - - debug( 'Rendering definitions...' ); - defs = svg.defs.render(); - - debug( 'Rendering marks...' ); - marks = renderMarks( state ); - - debug( 'Updating rendered components...' ); - - debug( 'Updating title...' ); - title.properties.attributes.x = state.paddingLeft + ( state.graphWidth/2 ); - title.properties.attributes.y = state.paddingTop / 2; - - debug( 'Updating x-axis...' ); - xAxis.properties.className += ' x'; - xAxis.properties.attributes.transform = xAxisTransform( state.xAxisOrient, state.graphHeight ); // eslint-disable-line max-len - - debug( 'Updating y-axis...' ); - yAxis.properties.className += ' y'; - yAxis.properties.attributes.transform = yAxisTransform( state.yAxisOrient, state.graphWidth ); // eslint-disable-line max-len - - debug( 'Assembling virtual tree...' ); - - debug( 'Inserting clip-path into definitions...' ); - defs.children.push( clipPath ); - defs.count += clipPath.count; - - debug( 'Inserting background into graph...' ); - graph.children.push( bkgd ); - graph.count += bkgd.count; - - debug( 'Inserting marks into graph...' ); - graph.children.push( marks ); - graph.count += marks.count; - - debug( 'Inserting x-axis into graph...' ); - graph.children.push( xAxis ); - graph.count += xAxis.count; - - debug( 'Inserting y-axis into graph...' ); - graph.children.push( yAxis ); - graph.count += yAxis.count; - - debug( 'Inserting title into annotations...' ); - annotations.children.push( title ); - annotations.count += title.count; - - debug( 'Inserting definitions into canvas...' ); - canvas.children.push( defs ); - canvas.count += defs.count; - - debug( 'Inserting graph into canvas...' ); - canvas.children.push( graph ); - canvas.count += graph.count; - - debug( 'Inserting annotations into canvas...' ); - canvas.children.push( annotations ); - canvas.count += annotations.count; - - return canvas; -} - - -// EXPORTS // - -module.exports = render; diff --git a/hist/lib/render/svg/init.js b/hist/lib/render/svg/init.js deleted file mode 100644 index 1ef6f13..0000000 --- a/hist/lib/render/svg/init.js +++ /dev/null @@ -1,176 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var Annotations = require( './../../../../components/svg/annotations' ); -var ClipPath = require( './../../../../components/svg/clip-path' ); -var Canvas = require( './../../../../components/svg/canvas' ); -var Graph = require( './../../../../components/svg/graph' ); -var Title = require( './../../../../components/svg/title' ); -var Marks = require( './../../../../components/svg/marks' ); -var Bkgd = require( './../../../../components/svg/background' ); -var Defs = require( './../../../../components/svg/defs' ); -var Axis = require( './../../../../components/svg/axis' ); - -// var Columns = require( './../../../../components/svg/columns' ); - - -// VARIABLES // - -var debug = logger( 'hist:render:svg:init' ); - - -// MAIN // - -/** -* Initializes SVG components. -* -* @private -* @param {Object} state - state -*/ -function init( state ) { - var svg = state.$.svg; - - debug( 'Initializing components...' ); - - debug( 'Initializing canvas component...' ); - defineProperty( svg, 'canvas', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Canvas({ - 'autoRender': false - }) - }); - - debug( 'Initializing definitions component...' ); - defineProperty( svg, 'defs', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Defs({ - 'autoRender': false - }) - }); - - debug( 'Initializing clipping path component...' ); - defineProperty( svg, 'clipPath', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new ClipPath({ - 'autoRender': false, - 'id': state._clipPathId // eslint-disable-line no-underscore-dangle - }) - }); - - debug( 'Initializing graph component...' ); - defineProperty( svg, 'graph', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Graph({ - 'autoRender': false - }) - }); - - debug( 'Initializing annotations component...' ); - defineProperty( svg, 'annotations', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Annotations({ - 'autoRender': false - }) - }); - - debug( 'Initializing title component...' ); - defineProperty( svg, 'title', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Title({ - 'autoRender': false - }) - }); - - debug( 'Initializing background component...' ); - defineProperty( svg, 'bkgd', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Bkgd({ - 'autoRender': false - }) - }); - - debug( 'Initializing marks component...' ); - defineProperty( svg, 'marks', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Marks({ - 'autoRender': false, - 'clipPathId': state._clipPathId // eslint-disable-line no-underscore-dangle - }) - }); - - /* - debug( 'Initializing columns component...' ); - defineProperty( svg, 'columns', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Columns({ - 'autoRender': false - }) - }); - */ - - debug( 'Initializing x-axis component...' ); - defineProperty( svg, 'xAxis', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Axis({ - 'autoRender': false - }) - }); - - debug( 'Initializing y-axis component...' ); - defineProperty( svg, 'yAxis', { - 'configurable': false, - 'enumerable': false, - 'writable': false, - 'value': new Axis({ - 'autoRender': false - }) - }); - - debug( 'All components initialized.' ); -} - - -// EXPORTS // - -module.exports = init; diff --git a/hist/lib/render/svg/marks/columns.js b/hist/lib/render/svg/marks/columns.js deleted file mode 100644 index ddb5a18..0000000 --- a/hist/lib/render/svg/marks/columns.js +++ /dev/null @@ -1,101 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'hist:render:svg:marks:columns' ); - - -// MAIN // - -/** -* Renders column marks. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var nOpacities; - var lineStyle; - var opacity; - var nColors; - var nStyles; - var nWidths; - var color; - var width; - var marks; - var line; - var len; - var i; - - // FIXME - - line = state.$.svg.path; - nOpacities = state.lineOpacity.length; - nStyles = state.lineStyle.length; - nWidths = state.lineWidth.length; - nColors = state.colors.length; - - len = state.x.length; - marks = []; - - debug( 'Rendering columns...' ); - for ( i = 0; i < len; i++ ) { - lineStyle = state.lineStyle[ i%nStyles ]; - debug( 'Line style: %s (%d).', lineStyle, i ); - - if ( lineStyle === 'none' ) { - debug( 'Line style (%d) is `none`. Skipping...', i ); - continue; - } - color = state.colors[ i%nColors ]; - debug( 'Line color: %s (%d).', color, i ); - - opacity = state.lineOpacity[ i%nOpacities ]; - debug( 'Line opacity: %s (%d).', opacity, i ); - - width = state.lineWidth[ i%nWidths ]; - debug( 'Line width: %s (%d).', width, i ); - - line.x = state.x[ i ]; - line.y = state.y[ i ]; - line.style = lineStyle; - line.label = state.labels[ i ] || ''; - line.color = color; - line.opacity = opacity; - line.width = width; - - debug( 'Rendering columns %d...', i ); - marks.push( line.render() ); - } - debug( 'Finished rendering columns.' ); - return marks; -} - - -// EXPORTS // - -module.exports = render; diff --git a/hist/lib/render/svg/marks/index.js b/hist/lib/render/svg/marks/index.js deleted file mode 100644 index f556c74..0000000 --- a/hist/lib/render/svg/marks/index.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var columns = require( './columns.js' ); - - -// VARIABLES // - -var debug = logger( 'hist:render:svg:marks' ); - - -// MAIN // - -/** -* Renders individual marks. -* -* @private -* @param {Object} state - state -* @returns {VTree} virtual tree -*/ -function render( state ) { - var parent; - var marks; - var len; - var i; - - debug( 'Rendering marks group...' ); - parent = state.$.svg.marks.render(); - - len = state.x.length; - if ( len === 0 ) { - debug( 'No individual marks to render.' ); - return parent; - } - marks = []; - - debug( 'Rendering columns...' ); - marks = marks.concat( columns( state ) ); - - debug( 'Inserting individual marks into marks group...' ); - for ( i = 0; i < marks.length; i++ ) { - parent.children.push( marks[i] ); - parent.count += marks[i].count; - } - debug( 'Finished rendering marks.' ); - return parent; -} - - -// EXPORTS // - -module.exports = render; diff --git a/hist/lib/render/svg/sync.js b/hist/lib/render/svg/sync.js deleted file mode 100644 index 6b426f8..0000000 --- a/hist/lib/render/svg/sync.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'hist:render:svg:sync' ); - - -// MAIN // - -/** -* Syncs SVG components with the current state. -* -* @private -* @param {Object} state - state -*/ -function sync( state ) { - var svg = state.$.svg; - - debug( 'Syncing...' ); - - debug( 'Syncing canvas...' ); - svg.canvas.width = state.width; - svg.canvas.height = state.height; - - debug( 'Syncing definitions...' ); - - // ... - - debug( 'Syncing clipping path...' ); - svg.clipPath.width = state.graphWidth; - svg.clipPath.height = state.graphHeight; - - debug( 'Syncing graph...' ); - svg.graph.translateX = state.paddingLeft; - svg.graph.translateY = state.paddingTop; - - debug( 'Syncing annotations...' ); - - // ... - - debug( 'Syncing title...' ); - svg.title.text = state.title; - - debug( 'Syncing background...' ); - svg.bkgd.width = state.graphWidth; - svg.bkgd.height = state.graphHeight; - - debug( 'Syncing marks...' ); - svg.marks.clipPathId = state._clipPathId; // eslint-disable-line no-underscore-dangle - - debug( 'Syncing columns...' ); - svg.columns.xScale = state.xScale; - svg.columns.yScale = state.yScale; - - // svg.columns.isDefined = state.isDefined; // TODO - - debug( 'Syncing x-axis...' ); - svg.xAxis.scale = state.xScale; - svg.xAxis.label = state.xLabel; - svg.xAxis.tickFormat = state.xTickFormat; - svg.xAxis.numTicks = state.xNumTicks; - svg.xAxis.orientation = state.xAxisOrient; - - debug( 'Syncing y-axis...' ); - svg.yAxis.scale = state.yScale; - svg.yAxis.label = state.yLabel; - svg.yAxis.tickFormat = state.yTickFormat; - svg.yAxis.numTicks = state.yNumTicks; - svg.yAxis.orientation = state.yAxisOrient; - - debug( 'Sync complete.' ); -} - - -// EXPORTS // - -module.exports = sync; diff --git a/hist/lib/render/svg/utils/x_axis_transform.js b/hist/lib/render/svg/utils/x_axis_transform.js deleted file mode 100644 index dba6773..0000000 --- a/hist/lib/render/svg/utils/x_axis_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns an x-axis translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} height - graph height -* @returns {string} transform -*/ -function xAxisTransform( orient, height ) { - if ( orient === 'top' ) { - return 'translate(0,0)'; - } - return 'translate(0,'+height+')'; -} - - -// EXPORTS // - -module.exports = xAxisTransform; diff --git a/hist/lib/render/svg/utils/y_axis_transform.js b/hist/lib/render/svg/utils/y_axis_transform.js deleted file mode 100644 index 2373863..0000000 --- a/hist/lib/render/svg/utils/y_axis_transform.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a y-axis translation transform. -* -* @private -* @param {string} orient - axis orientation -* @param {number} width - graph width -* @returns {string} transform -*/ -function yAxisTransform( orient, width ) { - if ( orient === 'left' ) { - return 'translate(0,0)'; - } - return 'translate('+width+',0)'; -} - - -// EXPORTS // - -module.exports = yAxisTransform; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 9a0feba..0000000 --- a/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Plot. -* -* @module @stdlib/plot -* -* @example -* var plot = require( '@stdlib/plot' ); -* -* var x = [ 1, 2, 3 ]; -* var y = [ 1, 0, 1 ]; -* -* var plt = plot( [ x ], [ y ] ); -*/ - -// MODULES // - -var plot = require( './../ctor' ); - - -// EXPORTS // - -module.exports = plot; diff --git a/mod.js b/mod.js new file mode 100644 index 0000000..fdf17f2 --- /dev/null +++ b/mod.js @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +var e="function"==typeof Object.defineProperty?Object.defineProperty:null;var t=Object.defineProperty;function n(e){return"number"==typeof e}function r(e){var t,n="";for(t=0;t0&&(n-=1),r=e.toExponential(n)):r=e.toPrecision(t.precision),t.alternate||(r=f.call(r,v,"$1e"),r=f.call(r,m,"e"),r=f.call(r,y,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return r=f.call(r,h,"e+0$1"),r=f.call(r,p,"e-0$1"),t.alternate&&(r=f.call(r,g,"$1."),r=f.call(r,d,"$1.e")),e>=0&&t.sign&&(r=t.sign+r),r=t.specifier===c.call(t.specifier)?c.call(r):l.call(r)}function w(e){var t,n="";for(t=0;t127)throw new Error("invalid character code. Value: "+a.arg);a.arg=A(s)?String(a.arg):E(s)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(t||(a.precision=6),f=parseFloat(a.arg),!isFinite(f)){if(!n(a.arg))throw new Error("invalid floating-point number. Value: "+l);f=a.arg,a.padZeros=!1}a.arg=b(f,a);break;default:throw new Error("invalid specifier: "+a.specifier)}a.maxWidth>=0&&a.arg.length>a.maxWidth&&(a.arg=a.arg.substring(0,a.maxWidth)),a.padZeros?a.arg=i(a.arg,a.width||a.precision,a.padRight):a.width&&(a.arg=_(a.arg,a.width,a.padRight)),l+=a.arg||"",c+=1}return l}var F=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function S(e){var t={mapping:e[1]?parseInt(e[1],10):void 0,flags:e[2],width:e[3],precision:e[5],specifier:e[6]};return"."===e[4]&&void 0===e[5]&&(t.precision="1"),t}function R(e){var t,n,r,i;for(n=[],i=0,r=F.exec(e);r;)(t=e.slice(i,F.lastIndex-r[0].length)).length&&n.push(t),"%"===r[6]?n.push("%"):n.push(S(r)),i=F.lastIndex,r=F.exec(e);return(t=e.slice(i)).length&&n.push(t),n}function D(e){var t,n;if("string"!=typeof e)throw new TypeError(D("invalid argument. First argument must be a string. Value: `%s`.",e));for(t=[R(e)],n=1;n0&&u.length>i){u.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=u.length,o=s,"function"==typeof console.warn?console.warn(o):console.log(o)}}else u=a[t]=n,++e._eventsCount;return e}function H(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function J(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function W(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}U.prototype=Object.create(null),z.EventEmitter=z,z.usingDomains=!1,z.prototype.domain=void 0,z.prototype._events=void 0,z.prototype._maxListeners=void 0,z.defaultMaxListeners=10,z.init=function(){this.domain=null,z.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new U,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},z.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},z.prototype.getMaxListeners=function(){return Y(this)},z.prototype.emit=function(e){var t,n,r,i,a,u,o,s="error"===e;if(u=this._events)s=s&&null==u.error;else if(!s)return!1;if(o=this.domain,s){if(t=arguments[1],!o){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=o,t.domainThrown=!1,o.emit("error",t),!1}if(!(n=u[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=W(e,r),a=0;a0;)if(n[a]===t||n[a].listener&&n[a].listener===t){u=n[a].listener,i=a;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new U,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]};var $=I(Object.freeze({__proto__:null,EventEmitter:z,default:z})),G=I(Object.freeze({__proto__:null,default:()=>()=>{}}));function X(e){return Object.keys(Object(e))}var Z=void 0!==Object.keys;var K="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function Q(){return K&&"symbol"==typeof Symbol.toStringTag}var ee=Object.prototype.toString;var te=Object.prototype.hasOwnProperty;function ne(e,t){return null!=e&&te.call(e,t)}var re,ie="function"==typeof Symbol?Symbol:void 0,ae="function"==typeof ie?ie.toStringTag:"";re=Q()?function(e){var t,n,r;if(null==e)return ee.call(e);n=e[ae],t=ne(e,ae);try{e[ae]=void 0}catch(t){return ee.call(e)}return r=ee.call(e),t?e[ae]=n:delete e[ae],r}:function(e){return ee.call(e)};var ue=re;function oe(e){return"[object Arguments]"===ue(e)}var se=function(){return oe(arguments)}();function le(e){return"string"==typeof e}var ce=String.prototype.valueOf;var fe=Q();function he(e){return"object"==typeof e&&(e instanceof String||(fe?function(e){try{return ce.call(e),!0}catch(e){return!1}}(e):"[object String]"===ue(e)))}function pe(e){return le(e)||he(e)}function ge(e){return"number"==typeof e}P(pe,"isPrimitive",le),P(pe,"isObject",he);var de=Number,ye=de.prototype.toString;var me=Q();function ve(e){return"object"==typeof e&&(e instanceof de||(me?function(e){try{return ye.call(e),!0}catch(e){return!1}}(e):"[object Number]"===ue(e)))}function be(e){return ge(e)||ve(e)}function we(e){return e!=e}function _e(e){return ge(e)&&we(e)}function Ee(e){return ve(e)&&we(e.valueOf())}function xe(e){return _e(e)||Ee(e)}P(be,"isPrimitive",ge),P(be,"isObject",ve),P(xe,"isPrimitive",_e),P(xe,"isObject",Ee);var Ae=Number.POSITIVE_INFINITY,Te=de.NEGATIVE_INFINITY,Ce=Math.floor;function Fe(e){return Ce(e)===e}function Se(e){return eTe&&Fe(e)}function Re(e){return ge(e)&&Se(e)}function De(e){return ve(e)&&Se(e.valueOf())}function ke(e){return Re(e)||De(e)}P(ke,"isPrimitive",Re),P(ke,"isObject",De);var Oe=Object.prototype.propertyIsEnumerable;var Be,Me=!Oe.call("beep","0");function Ne(e,t){var n;return null!=e&&(!(n=Oe.call(e,t))&&Me&&pe(e)?!_e(t=+t)&&Re(t)&&t>=0&&t=0&&e.length<=je&&ne(e,"callee")&&!Ne(e,"callee")};var Pe=Ve,Ie=Array.prototype.slice;function Ue(e){if("function"!=typeof e)throw new TypeError(D("invalid argument. Must provide a function. Value: `%s`.",e));return function(t){var n,r;if(!Le(t))return!1;if(0===(n=t.length))return!1;for(r=0;r=0&&e.length<=Je}function $e(e,t,n){var r,i;if(!We(e)&&!le(e))throw new TypeError(D("invalid argument. First argument must be an array-like object. Value: `%s`.",e));if(0===(r=e.length))return-1;if(3===arguments.length){if(!Re(n))throw new TypeError(D("invalid argument. Third argument must be an integer. Value: `%s`.",n));if(n>=0){if(n>=r)return-1;i=n}else(i=r+n)<0&&(i=0)}else i=0;if(xe(t)){for(;i0&&!ne(e,"0"))for(o=0;o=0}function Vt(e){return De(e)&&e.valueOf()>=0}function Lt(e){return Nt(e)||Vt(e)}function jt(e){if("object"!=typeof e||null===e)return!1;if(e instanceof Error)return!0;for(;e;){if("[object Error]"===ue(e))return!0;e=Ot(e)}return!1}function Pt(){return/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/}P(Lt,"isPrimitive",Nt),P(Lt,"isObject",Vt),P(Pt,"REGEXP",/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/);var It,Ut=void 0!==Object.getOwnPropertyNames,zt=Rt.getOwnPropertyNames;It=Ut?function(e){return zt(Rt(e))}:function(e){return At(Rt(e))};var Yt,qt=It,Ht=void 0!==Object.getOwnPropertyDescriptor,Jt=Object.getOwnPropertyDescriptor;Yt=Ht?function(e,t){var n;return null==e||void 0===(n=Jt(e,t))?null:n}:function(e,t){return ne(e,t)?{configurable:!0,enumerable:!0,writable:!0,value:e[t]}:null};var Wt=Yt,$t=[],Gt=[],Xt="undefined"!=typeof Uint8Array?Uint8Array:Array,Zt=!1;function Kt(){Zt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)$t[t]=e[t],Gt[e.charCodeAt(t)]=t;Gt["-".charCodeAt(0)]=62,Gt["_".charCodeAt(0)]=63}function Qt(e,t,n){for(var r,i,a=[],u=t;u>18&63]+$t[i>>12&63]+$t[i>>6&63]+$t[63&i]);return a.join("")}function en(e){var t;Zt||Kt();for(var n=e.length,r=n%3,i="",a=[],u=16383,o=0,s=n-r;os?s:o+u));return 1===r?(t=e[n-1],i+=$t[t>>2],i+=$t[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=$t[t>>10],i+=$t[t>>4&63],i+=$t[t<<2&63],i+="="),a.push(i),a.join("")}function tn(e,t,n,r,i){var a,u,o=8*i-r-1,s=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+f],f+=h,c-=8);for(u=a&(1<<-c)-1,a>>=-c,c+=r;c>0;u=256*u+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,r),a-=l}return(p?-1:1)*u*Math.pow(2,a-r)}function nn(e,t,n,r,i,a){var u,o,s,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-u))<1&&(u--,s*=2),(t+=u+f>=1?h/s:h*Math.pow(2,1-f))*s>=2&&(u++,s/=2),u+f>=c?(o=0,u=c):u+f>=1?(o=(t*s-1)*Math.pow(2,i),u+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),u=0));i>=8;e[n+p]=255&o,p+=g,o/=256,i-=8);for(u=u<0;e[n+p]=255&u,p+=g,u/=256,l-=8);e[n+p-g]|=128*d}var rn={}.toString,an=Array.isArray||function(e){return"[object Array]"==rn.call(e)};ln.TYPED_ARRAY_SUPPORT=void 0===it.TYPED_ARRAY_SUPPORT||it.TYPED_ARRAY_SUPPORT;var un=on();function on(){return ln.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function sn(e,t){if(on()=on())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+on().toString(16)+" bytes");return 0|e}function dn(e){return!(null==e||!e._isBuffer)}function yn(e,t){if(dn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Yn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return qn(e).length;default:if(r)return Yn(e).length;t=(""+t).toLowerCase(),r=!0}}function mn(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return On(this,t,n);case"utf8":case"utf-8":return Sn(this,t,n);case"ascii":return Dn(this,t,n);case"latin1":case"binary":return kn(this,t,n);case"base64":return Fn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bn(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function vn(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function bn(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=ln.from(t,r)),dn(t))return 0===t.length?-1:wn(e,t,n,r,i);if("number"==typeof t)return t&=255,ln.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):wn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function wn(e,t,n,r,i){var a,u=1,o=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;u=2,o/=2,s/=2,n/=2}function l(e,t){return 1===u?e[t]:e.readUInt16BE(t*u)}if(i){var c=-1;for(a=n;ao&&(n=o-s),a=n;a>=0;a--){for(var f=!0,h=0;hi&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var u=0;u>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function Fn(e,t,n){return 0===t&&n===e.length?en(e):en(e.slice(t,n))}function Sn(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(s=(31&l)<<6|63&a)>127&&(c=s);break;case 3:a=e[i+1],u=e[i+2],128==(192&a)&&128==(192&u)&&(s=(15&l)<<12|(63&a)<<6|63&u)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:a=e[i+1],u=e[i+2],o=e[i+3],128==(192&a)&&128==(192&u)&&128==(192&o)&&(s=(15&l)<<18|(63&a)<<12|(63&u)<<6|63&o)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=Rn)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},ln.prototype.compare=function(e,t,n,r,i){if(!dn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(t>>>=0),o=Math.min(a,u),s=this.slice(r,i),l=e.slice(t,n),c=0;ci)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _n(this,e,t,n);case"utf8":case"utf-8":return En(this,e,t,n);case"ascii":return xn(this,e,t,n);case"latin1":case"binary":return An(this,e,t,n);case"base64":return Tn(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cn(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},ln.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Rn=4096;function Dn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function Nn(e,t,n,r,i,a){if(!dn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Vn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function Ln(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function jn(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Pn(e,t,n,r,i){return i||jn(e,0,n,4),nn(e,t,n,r,23,4),n+4}function In(e,t,n,r,i){return i||jn(e,0,n,8),nn(e,t,n,r,52,8),n+8}ln.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},ln.prototype.readUInt8=function(e,t){return t||Mn(e,1,this.length),this[e]},ln.prototype.readUInt16LE=function(e,t){return t||Mn(e,2,this.length),this[e]|this[e+1]<<8},ln.prototype.readUInt16BE=function(e,t){return t||Mn(e,2,this.length),this[e]<<8|this[e+1]},ln.prototype.readUInt32LE=function(e,t){return t||Mn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ln.prototype.readUInt32BE=function(e,t){return t||Mn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ln.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Mn(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},ln.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Mn(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},ln.prototype.readInt8=function(e,t){return t||Mn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},ln.prototype.readInt16LE=function(e,t){t||Mn(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ln.prototype.readInt16BE=function(e,t){t||Mn(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ln.prototype.readInt32LE=function(e,t){return t||Mn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ln.prototype.readInt32BE=function(e,t){return t||Mn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ln.prototype.readFloatLE=function(e,t){return t||Mn(e,4,this.length),tn(this,e,!0,23,4)},ln.prototype.readFloatBE=function(e,t){return t||Mn(e,4,this.length),tn(this,e,!1,23,4)},ln.prototype.readDoubleLE=function(e,t){return t||Mn(e,8,this.length),tn(this,e,!0,52,8)},ln.prototype.readDoubleBE=function(e,t){return t||Mn(e,8,this.length),tn(this,e,!1,52,8)},ln.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Nn(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},ln.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,1,255,0),ln.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},ln.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,2,65535,0),ln.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Vn(this,e,t,!0),t+2},ln.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,2,65535,0),ln.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Vn(this,e,t,!1),t+2},ln.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,4,4294967295,0),ln.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Ln(this,e,t,!0),t+4},ln.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,4,4294967295,0),ln.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ln(this,e,t,!1),t+4},ln.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Nn(this,e,t,n,i-1,-i)}var a=0,u=1,o=0;for(this[t]=255&e;++a>0)-o&255;return t+n},ln.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Nn(this,e,t,n,i-1,-i)}var a=n-1,u=1,o=0;for(this[t+a]=255&e;--a>=0&&(u*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/u>>0)-o&255;return t+n},ln.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,1,127,-128),ln.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},ln.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,2,32767,-32768),ln.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Vn(this,e,t,!0),t+2},ln.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,2,32767,-32768),ln.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Vn(this,e,t,!1),t+2},ln.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,4,2147483647,-2147483648),ln.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Ln(this,e,t,!0),t+4},ln.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Nn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),ln.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ln(this,e,t,!1),t+4},ln.prototype.writeFloatLE=function(e,t,n){return Pn(this,e,t,!0,n)},ln.prototype.writeFloatBE=function(e,t,n){return Pn(this,e,t,!1,n)},ln.prototype.writeDoubleLE=function(e,t,n){return In(this,e,t,!0,n)},ln.prototype.writeDoubleBE=function(e,t,n){return In(this,e,t,!1,n)},ln.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!ln.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(u+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function qn(e){return function(e){var t,n,r,i,a,u;Zt||Kt();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[o-2]?2:"="===e[o-1]?1:0,u=new Xt(3*o/4-a),r=a>0?o-4:o;var s=0;for(t=0,n=0;t>16&255,u[s++]=i>>8&255,u[s++]=255&i;return 2===a?(i=Gt[e.charCodeAt(t)]<<2|Gt[e.charCodeAt(t+1)]>>4,u[s++]=255&i):1===a&&(i=Gt[e.charCodeAt(t)]<<10|Gt[e.charCodeAt(t+1)]<<4|Gt[e.charCodeAt(t+2)]>>2,u[s++]=i>>8&255,u[s++]=255&i),u}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Un,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Hn(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Jn(e){return null!=e&&(!!e._isBuffer||Wn(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Wn(e.slice(0,0))}(e))}function Wn(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var $n=Object.freeze({__proto__:null,Buffer:ln,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),ln.alloc(+e)},isBuffer:Jn,kMaxLength:un}),Gn=ln;var Xn,Zn=I($n).Buffer;Xn=function(){var e,t;if("function"!=typeof Gn)return!1;try{e=pt(t="function"==typeof Gn.from?Gn.from([1,2,3,4]):new Gn([1,2,3,4]))&&1===t[0]&&2===t[1]&&3===t[2]&&4===t[3]}catch(t){e=!1}return e}()?Zn:function(){throw new Error("not implemented")};var Kn=Xn;var Qn=Ft(Kn.from)?function(e){if(!pt(e))throw new TypeError(D("invalid argument. Must provide a Buffer. Value: `%s`.",e));return Kn.from(e)}:function(e){if(!pt(e))throw new TypeError(D("invalid argument. Must provide a Buffer. Value: `%s`.",e));return new Kn(e)},er="function"==typeof Int8Array;var tr="function"==typeof Int8Array?Int8Array:null;var nr,rr="function"==typeof Int8Array?Int8Array:void 0;nr=function(){var e,t,n;if("function"!=typeof tr)return!1;try{t=new tr([1,3.14,-3.14,128]),n=t,e=(er&&n instanceof Int8Array||"[object Int8Array]"===ue(n))&&1===t[0]&&3===t[1]&&-3===t[2]&&-128===t[3]}catch(t){e=!1}return e}()?rr:function(){throw new Error("not implemented")};var ir=nr,ar="function"==typeof Uint8Array;var ur="function"==typeof Uint8Array?Uint8Array:null;var or,sr="function"==typeof Uint8Array?Uint8Array:void 0;or=function(){var e,t,n;if("function"!=typeof ur)return!1;try{t=new ur(t=[1,3.14,-3.14,256,257]),n=t,e=(ar&&n instanceof Uint8Array||"[object Uint8Array]"===ue(n))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){e=!1}return e}()?sr:function(){throw new Error("not implemented")};var lr=or,cr="function"==typeof Uint8ClampedArray;var fr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var hr,pr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;hr=function(){var e,t,n;if("function"!=typeof fr)return!1;try{t=new fr([-1,0,1,3.14,4.99,255,256]),n=t,e=(cr&&n instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===ue(n))&&0===t[0]&&0===t[1]&&1===t[2]&&3===t[3]&&5===t[4]&&255===t[5]&&255===t[6]}catch(t){e=!1}return e}()?pr:function(){throw new Error("not implemented")};var gr=hr,dr="function"==typeof Int16Array;var yr="function"==typeof Int16Array?Int16Array:null;var mr,vr="function"==typeof Int16Array?Int16Array:void 0;mr=function(){var e,t,n;if("function"!=typeof yr)return!1;try{t=new yr([1,3.14,-3.14,32768]),n=t,e=(dr&&n instanceof Int16Array||"[object Int16Array]"===ue(n))&&1===t[0]&&3===t[1]&&-3===t[2]&&-32768===t[3]}catch(t){e=!1}return e}()?vr:function(){throw new Error("not implemented")};var br=mr,wr="function"==typeof Uint16Array;var _r="function"==typeof Uint16Array?Uint16Array:null;var Er,xr="function"==typeof Uint16Array?Uint16Array:void 0;Er=function(){var e,t,n;if("function"!=typeof _r)return!1;try{t=new _r(t=[1,3.14,-3.14,65536,65537]),n=t,e=(wr&&n instanceof Uint16Array||"[object Uint16Array]"===ue(n))&&1===t[0]&&3===t[1]&&65533===t[2]&&0===t[3]&&1===t[4]}catch(t){e=!1}return e}()?xr:function(){throw new Error("not implemented")};var Ar=Er,Tr="function"==typeof Int32Array;function Cr(e){return Tr&&e instanceof Int32Array||"[object Int32Array]"===ue(e)}var Fr=2147483647,Sr="function"==typeof Int32Array?Int32Array:null;var Rr,Dr="function"==typeof Int32Array?Int32Array:void 0;Rr=function(){var e,t;if("function"!=typeof Sr)return!1;try{e=Cr(t=new Sr([1,3.14,-3.14,2147483648]))&&1===t[0]&&3===t[1]&&-3===t[2]&&-2147483648===t[3]}catch(t){e=!1}return e}()?Dr:function(){throw new Error("not implemented")};var kr=Rr,Or="function"==typeof Uint32Array;var Br="function"==typeof Uint32Array?Uint32Array:null;var Mr,Nr="function"==typeof Uint32Array?Uint32Array:void 0;Mr=function(){var e,t,n;if("function"!=typeof Br)return!1;try{t=new Br(t=[1,3.14,-3.14,4294967296,4294967297]),n=t,e=(Or&&n instanceof Uint32Array||"[object Uint32Array]"===ue(n))&&1===t[0]&&3===t[1]&&4294967293===t[2]&&0===t[3]&&1===t[4]}catch(t){e=!1}return e}()?Nr:function(){throw new Error("not implemented")};var Vr=Mr,Lr="function"==typeof Float32Array;var jr="function"==typeof Float32Array?Float32Array:null;var Pr,Ir="function"==typeof Float32Array?Float32Array:void 0;Pr=function(){var e,t,n;if("function"!=typeof jr)return!1;try{t=new jr([1,3.14,-3.14,5e40]),n=t,e=(Lr&&n instanceof Float32Array||"[object Float32Array]"===ue(n))&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===Ae}catch(t){e=!1}return e}()?Ir:function(){throw new Error("not implemented")};var Ur=Pr,zr="function"==typeof Float64Array;var Yr="function"==typeof Float64Array?Float64Array:null;function qr(){var e,t,n;if("function"!=typeof Yr)return!1;try{t=new Yr([1,3.14,-3.14,NaN]),n=t,e=(zr&&n instanceof Float64Array||"[object Float64Array]"===ue(n))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){e=!1}return e}var Hr="function"==typeof Float64Array?Float64Array:void 0;var Jr=qr()?Hr:function(){throw new Error("not implemented")};function Wr(e){return new ir(e)}function $r(e){return new lr(e)}function Gr(e){return new gr(e)}function Xr(e){return new br(e)}function Zr(e){return new Ar(e)}function Kr(e){return new kr(e)}function Qr(e){return new Vr(e)}function ei(e){return new Ur(e)}function ti(e){return new Jr(e)}var ni={int8array:Wr,uint8array:$r,uint8clampedarray:Gr,int16array:Xr,uint16array:Zr,int32array:Kr,uint32array:Qr,float32array:ei,float64array:ti};function ri(e,t,n,r,i){var a,u,o,s,l,c,f,h,p,g;if(i-=1,"object"!=typeof e||null===e)return e;if(pt(e))return Qn(e);if(jt(e))return function(e){var t,n,r,i,a,u,o=[],s=[];for(a=new e.constructor(e.message),o.push(e),s.push(a),e.stack&&(a.stack=e.stack),e.code&&(a.code=e.code),e.errno&&(a.errno=e.errno),e.syscall&&(a.syscall=e.syscall),t=At(e),u=0;u0)for(a=o,g=0;g1){if(!Nt(t))throw new TypeError(D("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",t));if(0===t)return e}else t=Ae;return ri(e,n=Le(e)?new Array(e.length):{},[e],[n],t)}function ai(e){var t=typeof e;return null===e||"object"!==t&&"function"!==t?new TypeError(D("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.",e)):null}var ui,oi=Object.create;function si(){}ui="function"==typeof oi?oi:function(e){return si.prototype=e,new si};var li=ui;function ci(e,t){var n=ai(e);if(n)throw n;if(n=ai(t))throw n;if(void 0===t.prototype)throw new TypeError(D("invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.",t.prototype));return e.prototype=li(t.prototype),j(e.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:e}),e}function fi(){return{level:Ae,override:!0,extend:!0,copy:!0}}function hi(e,t,n,r,i,a){var u,o,s,l,c,f,h,p,g;for(o=Ft(i),n-=1,l=At(t),g=0;g0}function yi(e){return De(e)&&e.valueOf()>0}function mi(e){return di(e)||yi(e)}function vi(e){var t,n;if(n=function(e,t){return Mt(t)?ne(t,"level")&&(e.level=t.level,!di(e.level))?new TypeError(D("invalid option. `%s` option must be a positive integer. Option: `%s`.","level",e.level)):ne(t,"copy")&&(e.copy=t.copy,!Xe(e.copy))?new TypeError(D("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy)):!ne(t,"override")||(e.override=t.override,Xe(e.override)||Ft(e.override))?ne(t,"extend")&&(e.extend=t.extend,!Xe(e.extend))?new TypeError(D("invalid option. `%s` option must be a boolean. Option: `%s`.","extend",e.extend)):null:new TypeError(D("invalid option. `%s` option must be either a boolean or a function. Option: `%s`.","override",e.override)):new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t))}(t=fi(),e),n)throw n;return pi(t)}function bi(e,t,n){j(e,t,{configurable:!1,enumerable:!1,get:n})}function wi(e,t,n,r){j(e,t,{configurable:!1,enumerable:!1,get:n,set:r})}P(mi,"isPrimitive",di),P(mi,"isObject",yi),P(gi,"factory",vi);var _i="function";function Ei(e){return typeof e.get===_i&&typeof e.set===_i}var xi={float64:function(e,t){return e[t]},float32:function(e,t){return e[t]},int32:function(e,t){return e[t]},int16:function(e,t){return e[t]},int8:function(e,t){return e[t]},uint32:function(e,t){return e[t]},uint16:function(e,t){return e[t]},uint8:function(e,t){return e[t]},uint8c:function(e,t){return e[t]},generic:function(e,t){return e[t]},default:function(e,t){return e[t]}};function Ai(e){var t=xi[e];return"function"==typeof t?t:xi.default}var Ti={float64:function(e,t,n){e[t]=n},float32:function(e,t,n){e[t]=n},int32:function(e,t,n){e[t]=n},int16:function(e,t,n){e[t]=n},int8:function(e,t,n){e[t]=n},uint32:function(e,t,n){e[t]=n},uint16:function(e,t,n){e[t]=n},uint8:function(e,t,n){e[t]=n},uint8c:function(e,t,n){e[t]=n},generic:function(e,t,n){e[t]=n},default:function(e,t,n){e[t]=n}};function Ci(e){var t=Ti[e];return"function"==typeof t?t:Ti.default}var Fi={complex128:function(e,t){return e.get(t)},complex64:function(e,t){return e.get(t)},default:function(e,t){return e.get(t)}};function Si(e){var t=Fi[e];return"function"==typeof t?t:Fi.default}var Ri={complex128:function(e,t,n){e.set(n,t)},complex64:function(e,t,n){e.set(n,t)},default:function(e,t,n){e.set(n,t)}};function Di(e){var t=Ri[e];return"function"==typeof t?t:Ri.default}var ki={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"},Oi=4294967295;function Bi(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&Fe(e.length)&&e.length>=0&&e.length<=Oi}var Mi="function"==typeof ArrayBuffer;function Ni(e){return Mi&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===ue(e)}var Vi=Ue(pe.isPrimitive),Li=Ue(pe.isObject),ji=Ue(pe);function Pi(e,t){if(!(this instanceof Pi))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!ge(e))throw new TypeError(D("invalid argument. Real component must be a number. Value: `%s`.",e));if(!ge(t))throw new TypeError(D("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return j(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),j(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:t}),this}P(ji,"primitives",Vi),P(ji,"objects",Li),P(Pi,"BYTES_PER_ELEMENT",8),P(Pi.prototype,"BYTES_PER_ELEMENT",8),P(Pi.prototype,"byteLength",16),P(Pi.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),P(Pi.prototype,"toJSON",(function(){var e={type:"Complex128"};return e.re=this.re,e.im=this.im,e}));var Ii,Ui="function"==typeof Math.fround?Math.fround:null,zi=new Ur(1);Ii="function"==typeof Ui?Ui:function(e){return zi[0]=e,zi[0]};var Yi=Ii;function qi(e,t){if(!(this instanceof qi))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!ge(e))throw new TypeError(D("invalid argument. Real component must be a number. Value: `%s`.",e));if(!ge(t))throw new TypeError(D("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return j(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Yi(e)}),j(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Yi(t)}),this}function Hi(e){return e instanceof Pi||e instanceof qi||"object"==typeof e&&null!==e&&"number"==typeof e.re&&"number"==typeof e.im}function Ji(e){return Fe(e/2)}P(qi,"BYTES_PER_ELEMENT",4),P(qi.prototype,"BYTES_PER_ELEMENT",4),P(qi.prototype,"byteLength",8),P(qi.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),P(qi.prototype,"toJSON",(function(){var e={type:"Complex64"};return e.re=this.re,e.im=this.im,e}));var Wi=8;function $i(e){return"object"==typeof e&&null!==e&&"Complex64Array"===e.constructor.name&&e.BYTES_PER_ELEMENT===Wi}var Gi=16;function Xi(e){return"object"==typeof e&&null!==e&&"Complex128Array"===e.constructor.name&&e.BYTES_PER_ELEMENT===Gi}function Zi(){return"function"==typeof ie&&"symbol"==typeof ie("foo")&&ne(ie,"iterator")&&"symbol"==typeof ie.iterator}var Ki=Zi()?Symbol.iterator:null;function Qi(e){return e.re}function ea(e){return e.im}function ta(e,t){return new Ur(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*t,2*(e.length-t))}function na(e,t){return new Jr(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*t,2*(e.length-t))}function ra(e){var t,n,r;for(t=[];!(n=e.next()).done;)if(Bi(r=n.value)&&r.length>=2)t.push(r[0],r[1]);else{if(!Hi(r))return new TypeError(D("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));t.push(Qi(r),ea(r))}return t}var ia=2*Ur.BYTES_PER_ELEMENT,aa=Zi();function ua(e){return e instanceof la||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function oa(e){return e===la||"Complex128Array"===e.name}function sa(e,t){return new qi(e[t*=2],e[t+1])}function la(){var e,t,n,r;if(t=arguments.length,!(this instanceof la))return 0===t?new la:1===t?new la(arguments[0]):2===t?new la(arguments[0],arguments[1]):new la(arguments[0],arguments[1],arguments[2]);if(0===t)n=new Ur(0);else if(1===t)if(Nt(arguments[0]))n=new Ur(2*arguments[0]);else if(We(arguments[0]))if((r=(n=arguments[0]).length)&&Le(n)&&Hi(n[0])){if(n=function(e,t){var n,r,i,a;for(n=t.length,a=0,i=0;in.byteLength-e)throw new RangeError(D("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*ia));n=new Ur(n,e,2*r)}}return P(this,"_buffer",n),P(this,"_length",n.length/2),this}function ca(e){return e.re}function fa(e){return e.im}function ha(e){var t,n,r;for(t=[];!(n=e.next()).done;)if(Bi(r=n.value)&&r.length>=2)t.push(r[0],r[1]);else{if(!Hi(r))return new TypeError(D("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));t.push(ca(r),fa(r))}return t}P(la,"BYTES_PER_ELEMENT",ia),P(la,"name","Complex64Array"),P(la,"from",(function(e){var t,n,r,i,a,u,o,s,l,c,f,h;if(!Ft(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!oa(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((n=arguments.length)>1){if(!Ft(r=arguments[1]))throw new TypeError(D("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(t=arguments[2])}if(ua(e)){if(s=e.length,r){for(a=(i=new this(s))._buffer,h=0,f=0;f=2))throw new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));a[h]=c[0],a[h+1]=c[1]}h+=2}return i}return new this(e)}if(We(e)){if(r){for(s=e.length,o=e.get&&e.set?Si("default"):Ai("default"),f=0;f=2))throw new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));a[h]=c[0],a[h+1]=c[1]}h+=2}return i}return new this(e)}if(Ct(e)&&aa&&Ft(e[Ki])){if(!Ft((a=e[Ki]()).next))throw new TypeError(D("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(u=r?function(e,t,n){var r,i,a,u;for(r=[],u=-1;!(i=e.next()).done;)if(u+=1,Bi(a=t.call(n,i.value,u))&&a.length>=2)r.push(a[0],a[1]);else{if(!Hi(a))return new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));r.push(Qi(a),ea(a))}return r}(a,r,t):ra(a),u instanceof Error)throw u;for(a=(i=new this(s=u.length/2))._buffer,f=0;f=this._length))return sa(this._buffer,e)})),bi(la.prototype,"buffer",(function(){return this._buffer.buffer})),bi(la.prototype,"byteLength",(function(){return this._buffer.byteLength})),bi(la.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(la.prototype,"BYTES_PER_ELEMENT",la.BYTES_PER_ELEMENT),P(la.prototype,"copyWithin",(function(e,t){if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*t):this._buffer.copyWithin(2*e,2*t,2*arguments[2]),this})),P(la.prototype,"entries",(function(){var e,t,n,r,i,a;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,a=-1,P(t={},"next",(function(){if(a+=1,i||a>=n)return{done:!0};return{value:[a,sa(r,a)],done:!1}})),P(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(t,Ki,(function(){return e.entries()})),t})),P(la.prototype,"every",(function(e,t){var n,r;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!Fe(n))throw new TypeError(D("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else t=0,n=i;for(u=Qi(e),o=ea(e),s=t;s=0;r--)if(i=sa(n,r),e.call(t,i,r,this))return i})),P(la.prototype,"findLastIndex",(function(e,t){var n,r,i;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=sa(n,r),e.call(t,i,r,this))return r;return-1})),P(la.prototype,"forEach",(function(e,t){var n,r,i;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r=this._length))return sa(this._buffer,e)})),P(la.prototype,"includes",(function(e,t){var n,r,i,a,u;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Hi(e))throw new TypeError(D("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=Qi(e),a=ea(e),n=this._buffer,u=t;u1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=Qi(e),a=ea(e),n=this._buffer,u=t;u=n)return{done:!0};return{value:i,done:!1}})),P(t,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(t,Ki,(function(){return e.keys()})),t})),P(la.prototype,"lastIndexOf",(function(e,t){var n,r,i,a,u;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Hi(e))throw new TypeError(D("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(i=Qi(e),a=ea(e),n=this._buffer,u=t;u>=0;u--)if(i===n[r=2*u]&&a===n[r+1])return u;return-1})),bi(la.prototype,"length",(function(){return this._length})),P(la.prototype,"map",(function(e,t){var n,r,i,a,u;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(r=this._buffer,n=(i=new this.constructor(this._length))._buffer,a=0;a1)r=t,a=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=sa(n,0),a=1}for(;a1)r=t,a=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=sa(n,i-1),a=i-2}for(;a>=0;a--)r=e(r,sa(n,a),a,this);return r})),P(la.prototype,"reverse",(function(){var e,t,n,r,i,a;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,e=this._buffer,r=Ce(n/2),i=0;i1){if(!Nt(n=arguments[1]))throw new TypeError(D("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(Hi(e)){if(n>=this._length)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));return r[n*=2]=Qi(e),void(r[n+1]=ea(e))}if(ua(e)){if(n+(u=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,l=r.byteOffset+n*ia,t.buffer===r.buffer&&t.byteOffsetl){for(i=new Ur(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,l=r.byteOffset+n*ia,t.buffer===r.buffer&&t.byteOffsetl){for(i=new Ur(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,s=0;so&&(t=o)}}for(n=ei&&(t=i)}}return e>=i?(i=0,n=r.byteLength):e>=t?(i=0,n=r.byteOffset+e*ia):(i=t-e,n=r.byteOffset+e*ia),new this.constructor(r.buffer,n,i<0?0:i)})),P(la.prototype,"toLocaleString",(function(e,t){var n,r,i,a,u;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!le(e)&&!Vi(e))throw new TypeError(D("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",e));r=e}if(arguments.length<2)n={};else{if(!Ct(t))throw new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t));n=t}for(a=this._buffer,i=[],u=0;u=n)return{done:!0};return{value:sa(i,a),done:!1}})),P(e,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(e,Ki,(function(){return t.values()})),e})),P(la.prototype,"with",(function(e,t){var n,r,i;if(!ua(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fe(e))throw new TypeError(D("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Hi(t))throw new TypeError(D("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(n=(r=new this.constructor(this._buffer))._buffer)[2*e]=Qi(t),n[2*e+1]=ea(t),r}));var pa=2*Jr.BYTES_PER_ELEMENT,ga=Zi();function da(e){return e instanceof va||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function ya(e){return e===va||"Complex64Array"===e.name}function ma(e,t){return new Pi(e[t*=2],e[t+1])}function va(){var e,t,n,r;if(t=arguments.length,!(this instanceof va))return 0===t?new va:1===t?new va(arguments[0]):2===t?new va(arguments[0],arguments[1]):new va(arguments[0],arguments[1],arguments[2]);if(0===t)n=new Jr(0);else if(1===t)if(Nt(arguments[0]))n=new Jr(2*arguments[0]);else if(We(arguments[0]))if((r=(n=arguments[0]).length)&&Le(n)&&Hi(n[0])){if(n=function(e,t){var n,r,i,a;for(n=t.length,a=0,i=0;in.byteLength-e)throw new RangeError(D("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*pa));n=new Jr(n,e,2*r)}}return P(this,"_buffer",n),P(this,"_length",n.length/2),this}function ba(e){var t,n;for(t=[];!(n=e.next()).done;)t.push(Ze(n.value));return t}P(va,"BYTES_PER_ELEMENT",pa),P(va,"name","Complex128Array"),P(va,"from",(function(e){var t,n,r,i,a,u,o,s,l,c,f,h;if(!Ft(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ya(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((n=arguments.length)>1){if(!Ft(r=arguments[1]))throw new TypeError(D("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(t=arguments[2])}if(da(e)){if(s=e.length,r){for(a=(i=new this(s))._buffer,h=0,f=0;f=2))throw new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));a[h]=c[0],a[h+1]=c[1]}h+=2}return i}return new this(e)}if(We(e)){if(r){for(s=e.length,o=e.get&&e.set?Si("default"):Ai("default"),f=0;f=2))throw new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));a[h]=c[0],a[h+1]=c[1]}h+=2}return i}return new this(e)}if(Ct(e)&&ga&&Ft(e[Ki])){if(!Ft((a=e[Ki]()).next))throw new TypeError(D("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(u=r?function(e,t,n){var r,i,a,u;for(r=[],u=-1;!(i=e.next()).done;)if(u+=1,Bi(a=t.call(n,i.value,u))&&a.length>=2)r.push(a[0],a[1]);else{if(!Hi(a))return new TypeError(D("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));r.push(ca(a),fa(a))}return r}(a,r,t):ha(a),u instanceof Error)throw u;for(a=(i=new this(s=u.length/2))._buffer,f=0;f=this._length))return ma(this._buffer,e)})),bi(va.prototype,"buffer",(function(){return this._buffer.buffer})),bi(va.prototype,"byteLength",(function(){return this._buffer.byteLength})),bi(va.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(va.prototype,"BYTES_PER_ELEMENT",va.BYTES_PER_ELEMENT),P(va.prototype,"copyWithin",(function(e,t){if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*t):this._buffer.copyWithin(2*e,2*t,2*arguments[2]),this})),P(va.prototype,"entries",(function(){var e,t,n,r,i,a,u;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,r=this._length,a=-1,u=-2,P(n={},"next",(function(){var t;if(a+=1,i||a>=r)return{done:!0};return t=new Pi(e[u+=2],e[u+1]),{value:[a,t],done:!1}})),P(n,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(n,Ki,(function(){return t.entries()})),n})),P(va.prototype,"every",(function(e,t){var n,r;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!Fe(n))throw new TypeError(D("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else t=0,n=i;for(u=ca(e),o=fa(e),s=t;s=0;r--)if(i=ma(n,r),e.call(t,i,r,this))return i})),P(va.prototype,"findLastIndex",(function(e,t){var n,r,i;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=ma(n,r),e.call(t,i,r,this))return r;return-1})),P(va.prototype,"forEach",(function(e,t){var n,r,i;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r=this._length))return ma(this._buffer,e)})),bi(va.prototype,"length",(function(){return this._length})),P(va.prototype,"includes",(function(e,t){var n,r,i,a,u;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Hi(e))throw new TypeError(D("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ca(e),a=fa(e),n=this._buffer,u=t;u1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ca(e),a=fa(e),n=this._buffer,u=t;u=n)return{done:!0};return{value:i,done:!1}})),P(t,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(t,Ki,(function(){return e.keys()})),t})),P(va.prototype,"lastIndexOf",(function(e,t){var n,r,i,a,u;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Hi(e))throw new TypeError(D("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Fe(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(i=ca(e),a=fa(e),n=this._buffer,u=t;u>=0;u--)if(i===n[r=2*u]&&a===n[r+1])return u;return-1})),P(va.prototype,"map",(function(e,t){var n,r,i,a,u;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(r=this._buffer,n=(i=new this.constructor(this._length))._buffer,a=0;a1)r=t,a=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=ma(n,0),a=1}for(;a1)r=t,a=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=ma(n,i-1),a=i-2}for(;a>=0;a--)r=e(r,ma(n,a),a,this);return r})),P(va.prototype,"reverse",(function(){var e,t,n,r,i,a;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,e=this._buffer,r=Ce(n/2),i=0;i1){if(!Nt(n=arguments[1]))throw new TypeError(D("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(Hi(e)){if(n>=this._length)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));return r[n*=2]=ca(e),void(r[n+1]=fa(e))}if(da(e)){if(n+(u=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,l=r.byteOffset+n*pa,t.buffer===r.buffer&&t.byteOffsetl){for(i=new Jr(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,l=r.byteOffset+n*pa,t.buffer===r.buffer&&t.byteOffsetl){for(i=new Jr(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,s=0;so&&(t=o)}}for(n=ei&&(t=i)}}return e>=i?(i=0,n=r.byteLength):e>=t?(i=0,n=r.byteOffset+e*pa):(i=t-e,n=r.byteOffset+e*pa),new this.constructor(r.buffer,n,i<0?0:i)})),P(va.prototype,"toLocaleString",(function(e,t){var n,r,i,a,u;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!pe(e)&&!Vi(e))throw new TypeError(D("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",e));r=e}if(arguments.length<2)n={};else{if(!Ct(t))throw new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t));n=t}for(a=this._buffer,i=[],u=0;u=n)return{done:!0};return{value:ma(i,a),done:!1}})),P(e,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(e,Ki,(function(){return t.values()})),e})),P(va.prototype,"with",(function(e,t){var n,r,i;if(!da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fe(e))throw new TypeError(D("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Hi(t))throw new TypeError(D("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(n=(r=new this.constructor(this._buffer))._buffer)[2*e]=ca(t),n[2*e+1]=fa(t),r}));var wa=lr.BYTES_PER_ELEMENT,_a=Zi();function Ea(e){return"object"==typeof e&&null!==e&&"BooleanArray"===e.constructor.name&&e.BYTES_PER_ELEMENT===wa}function xa(e){return e===Aa}function Aa(){var e,t,n,r,i;if(t=arguments.length,!(this instanceof Aa))return 0===t?new Aa:1===t?new Aa(arguments[0]):2===t?new Aa(arguments[0],arguments[1]):new Aa(arguments[0],arguments[1],arguments[2]);if(0===t)n=new lr(0);else if(1===t)if(Nt(i=arguments[0]))n=new lr(i);else if(We(i))n=function(e,t){var n,r;for(n=t.length,r=0;rn.byteLength-e)throw new RangeError(D("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*wa));n=new lr(n,e,r)}}return P(this,"_buffer",n),P(this,"_length",n.length),this}P(Aa,"BYTES_PER_ELEMENT",wa),P(Aa,"name","BooleanArray"),P(Aa,"from",(function(e){var t,n,r,i,a,u,o,s,l;if(!Ft(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!xa(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((n=arguments.length)>1){if(!Ft(r=arguments[1]))throw new TypeError(D("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(t=arguments[2])}if(We(e)){if(r){for(s=e.length,o=e.get&&e.set?Si("default"):Ai("default"),a=(i=new this(s))._buffer,l=0;l=n))return Ze(t[e])})),bi(Aa.prototype,"buffer",(function(){return this._buffer.buffer})),bi(Aa.prototype,"byteLength",(function(){return this._buffer.byteLength})),bi(Aa.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(Aa.prototype,"BYTES_PER_ELEMENT",Aa.BYTES_PER_ELEMENT),P(Aa.prototype,"copyWithin",(function(e,t){if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(e,t):this._buffer.copyWithin(e,t,arguments[2]),this})),P(Aa.prototype,"entries",(function(){var e,t,n,r,i,a;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return e=this,r=this._buffer,n=this._length,a=-1,P(t={},"next",(function(){if(a+=1,i||a>=n)return{done:!0};return{value:[a,Ze(r[a])],done:!1}})),P(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(t,Ki,(function(){return e.entries()})),t})),P(Aa.prototype,"every",(function(e,t){var n,r;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r1){if(!Re(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!Re(n))throw new TypeError(D("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else t=0,n=i;for(a=e?1:0,u=t;u=0;i--)if(r=Ze(n[i]),e.call(t,r,i,this))return r})),P(Aa.prototype,"findLastIndex",(function(e,t){var n,r,i;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,i=this._length-1;i>=0;i--)if(r=Ze(n[i]),e.call(t,r,i,this))return i;return-1})),P(Aa.prototype,"forEach",(function(e,t){var n,r;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ft(e))throw new TypeError(D("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r=this._length))return Ze(this._buffer[e])})),P(Aa.prototype,"includes",(function(e,t){var n,r;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Xe(e))throw new TypeError(D("invalid argument. First argument must be a boolean. Value: `%s`.",e));if(arguments.length>1){if(!Re(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(n=this._buffer,r=t;r1){if(!Re(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(n=this._buffer,r=t;r0){if(!le(e))throw new TypeError(D("invalid argument. First argument must be a string. Value: `%s`.",e))}else e=",";for(t=this._buffer,n=[],r=0;r=n)return{done:!0};return{value:i,done:!1}})),P(t,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(t,Ki,(function(){return e.keys()})),t})),P(Aa.prototype,"lastIndexOf",(function(e,t){var n,r;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Xe(e))throw new TypeError(D("invalid argument. First argument must be a boolean. Value: `%s`.",e));if(arguments.length>1){if(!Re(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=this._buffer,r=t;r>=0;r--)if(e===Ze(n[r]))return r;return-1})),bi(Aa.prototype,"length",(function(){return this._length})),P(Aa.prototype,"map",(function(e,t){var n,r,i,a;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ft(e))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",e);for(i=this._buffer,n=(r=new this.constructor(this._length))._buffer,a=0;a1)i=t,a=0;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Ze(n[0]),a=1}for(;a1)i=t,a=r-1;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Ze(n[r-1]),a=r-2}for(;a>=0;a--)i=e(i,Ze(n[a]),a,this);return i})),P(Aa.prototype,"reverse",(function(){var e,t,n,r,i,a;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(e=this._buffer,n=this._length,r=Ce(n/2),i=0;i1){if(!Nt(n=arguments[1]))throw new TypeError(D("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(We(e)){if(n+(a=e.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=Ea(e)?e._buffer:e,o=r.byteOffset+n*wa,t.buffer===r.buffer&&t.byteOffseto){for(i=new lr(t.length),u=0;u=this._length)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));r[n]=e?1:0}})),P(Aa.prototype,"slice",(function(e,t){var n,r,i,a,u,o;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,t=u;else{if(!Re(e))throw new TypeError(D("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)t=u;else{if(!Re(t))throw new TypeError(D("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=u)<0&&(t=0):t>u&&(t=u)}}for(n=ei&&(t=i)}}return e>=i?(i=0,n=r.byteLength):e>=t?(i=0,n=r.byteOffset+e*wa):(i=t-e,n=r.byteOffset+e*wa),new this.constructor(r.buffer,n,i<0?0:i)})),P(Aa.prototype,"toLocaleString",(function(e,t){var n,r,i,a,u;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)r=[];else{if(!le(e)&&!Vi(e))throw new TypeError(D("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",e));r=e}if(arguments.length<2)n={};else{if(!Ct(t))throw new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t));n=t}for(a=this._buffer,i=[],u=0;u=n)return{done:!0};return{value:Ze(i[a]),done:!1}})),P(e,"return",(function(e){if(r=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Ki&&P(e,Ki,(function(){return t.values()})),e})),P(Aa.prototype,"with",(function(e,t){var n,r;if(!Ea(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Re(e))throw new TypeError(D("invalid argument. First argument must be an integer. Value: `%s`.",e));if(r=this._length,e<0&&(e+=r),e<0||e>=r)throw new RangeError(D("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Xe(t))throw new TypeError(D("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return(n=new this.constructor(this._buffer))._buffer[e]=t?1:0,n}));var Ta=[Jr,Ur,kr,Vr,br,Ar,ir,lr,gr,la,va,Aa],Ca=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Fa=Ca.length;function Sa(e){var t;if(Le(e))return"generic";if(pt(e))return null;for(t=0;t0)for(c=0;c0)for(h=0;h2147483646)throw new RangeError(D("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",i));i|=0}else{if(!(We(i)&&i.length>0))throw new TypeError(D("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",i));a=i.length,(t=new kr(Qa+a))[0]=Ga,t[1]=Xa,t[Za]=1,t[Ka]=a,Oa.ndarray(a,i,1,0,t,1,Ka+1),n=new kr(t.buffer,t.byteOffset+(Za+1)*t.BYTES_PER_ELEMENT,1),i=new kr(t.buffer,t.byteOffset+(Ka+1)*t.BYTES_PER_ELEMENT,a),n[0]=i[0]}else i=0|Wa()}else i=0|Wa();return void 0===n&&((t=new kr(Qa+1))[0]=Ga,t[1]=Xa,t[Za]=1,t[Ka]=1,t[Ka+1]=i,n=new kr(t.buffer,t.byteOffset+(Za+1)*t.BYTES_PER_ELEMENT,1),i=new kr(t.buffer,t.byteOffset+(Ka+1)*t.BYTES_PER_ELEMENT,1),n[0]=i[0]),P(g,"NAME","minstd"),bi(g,"seed",o),bi(g,"seedLength",s),wi(g,"state",f,h),bi(g,"stateLength",l),bi(g,"byteLength",c),P(g,"toJSON",p),P(g,"MIN",1),P(g,"MAX",2147483646),P(g,"normalized",d),P(d,"NAME",g.NAME),bi(d,"seed",o),bi(d,"seedLength",s),wi(d,"state",f,h),bi(d,"stateLength",l),bi(d,"byteLength",c),P(d,"toJSON",p),P(d,"MIN",(g.MIN-1)/$a),P(d,"MAX",(g.MAX-1)/$a),g;function o(){var e=t[Ka];return Oa(e,i,1,new kr(e),1)}function s(){return t[Ka]}function l(){return t.length}function c(){return t.byteLength}function f(){var e=t.length;return Oa(e,t,1,new kr(e),1)}function h(e){var a;if(!Cr(e))throw new TypeError(D("invalid argument. Must provide an Int32Array. Value: `%s`.",e));if(a=eu(e,!1))throw a;!1===r.copy?r.state&&e.length===t.length?Oa(e.length,e,1,t,1):(t=e,r.state=!0):(e.length!==t.length&&(t=new kr(e.length)),Oa(e.length,e,1,t,1)),n=new kr(t.buffer,t.byteOffset+(Za+1)*t.BYTES_PER_ELEMENT,1),i=new kr(t.buffer,t.byteOffset+(Ka+1)*t.BYTES_PER_ELEMENT,t[Ka])}function p(){var e={type:"PRNG"};return e.name=g.NAME,e.state=Ha(t),e.params=[],e}function g(){var e=0|n[0];return e=16807*e%Fr|0,n[0]=e,0|e}function d(){return(g()-1)/$a}}var nu=tu({seed:Wa()});function ru(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}P(nu,"factory",tu);var iu=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,au=function(e){return iu.exec(e).slice(1)};function uu(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=ru(du(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function ou(e){var t=su(e),n="/"===yu(e,-1);return(e=ru(du(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function su(e){return"/"===e.charAt(0)}function lu(){return ou(du(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function cu(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=uu(e).substr(1),t=uu(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),a=Math.min(r.length,i.length),u=a,o=0;o]/,bu=function(e){var t,n=""+e,r=vu.exec(n);if(!r)return n;var i="",a=0,u=0;for(a=r.index;a-1?t.substr(r+1):t;e.removeAttributeNS(this.namespace,i)}},Ou.prototype.type="AttributeHook";var Bu,Mu,Nu={tr:{regexp:/\u0130|\u0049|\u0049\u0307/g,map:{"İ":"i",I:"ı","İ":"i"}},az:{regexp:/[\u0130]/g,map:{"İ":"i",I:"ı","İ":"i"}},lt:{regexp:/[\u0049\u004A\u012E\u00CC\u00CD\u0128]/g,map:{I:"i̇",J:"j̇","Į":"į̇","Ì":"i̇̀","Í":"i̇́","Ĩ":"i̇̃"}}},Vu=function(e,t){var n=Nu[t];return e=null==e?"":String(e),n&&(e=e.replace(n.regexp,(function(e){return n.map[e]}))),e.toLowerCase()},Lu=/[^\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]+/g,ju=/([\u0061-\u007A\u00B5\u00DF-\u00F6\u00F8-\u00FF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1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\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A])([\u0041-\u005A\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])/g,Pu=/([\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])([^\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])/g,Iu=function(e,t,n){if(null==e)return"";return n=n||" ",e=String(e).replace(ju,"$1 $2").replace(Pu,"$1 $2").replace(Lu,(function(e,t,r){return 0===t||t===r.length-e.length?"":n})),Vu(e,t)},Uu={BOOLEAN:1,OVERLOADED_BOOLEAN:2},zu={attributeTypes:Uu,properties:{accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allowFullScreen:Uu.BOOLEAN,allowTransparency:!0,alt:!0,async:Uu.BOOLEAN,autocomplete:!0,autofocus:Uu.BOOLEAN,autoplay:Uu.BOOLEAN,cellPadding:!0,cellSpacing:!0,charset:!0,checked:Uu.BOOLEAN,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:Uu.BOOLEAN,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,defer:Uu.BOOLEAN,dir:!0,disabled:Uu.BOOLEAN,download:Uu.OVERLOADED_BOOLEAN,draggable:!0,enctype:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:Uu.BOOLEAN,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:Uu.BOOLEAN,href:!0,hreflang:!0,htmlFor:!0,httpEquiv:!0,icon:!0,id:!0,label:!0,lang:!0,list:!0,loop:Uu.BOOLEAN,manifest:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,multiple:Uu.BOOLEAN,muted:Uu.BOOLEAN,name:!0,noValidate:Uu.BOOLEAN,open:!0,pattern:!0,placeholder:!0,poster:!0,preload:!0,radiogroup:!0,readOnly:Uu.BOOLEAN,rel:!0,required:Uu.BOOLEAN,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scrolling:!0,seamless:Uu.BOOLEAN,selected:Uu.BOOLEAN,shape:!0,size:!0,sizes:!0,span:!0,spellcheck:!0,src:!0,srcdoc:!0,srcset:!0,start:!0,step:!0,style:!0,tabIndex:!0,target:!0,title:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,autocapitalize:!0,autocorrect:!0,itemProp:!0,itemScope:Uu.BOOLEAN,itemType:!0,property:!0},attributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}},Yu=bu,qu=zu.attributeTypes,Hu=zu.properties,Ju=zu.attributeNames,Wu=(Bu=function(e){return Yu(e)+'="'},Mu={},function(e){return Mu.hasOwnProperty(e)?Mu[e]:Mu[e]=Bu.call(this,e)}),$u=function(e,t,n){if(Hu.hasOwnProperty(e)){if(function(e,t){var n=Hu[e];return null==t||n===qu.BOOLEAN&&!t||n===qu.OVERLOADED_BOOLEAN&&!1===t}(e,t))return"";e=(Ju[e]||e).toLowerCase();var r=Hu[e];return r===qu.BOOLEAN||r===qu.OVERLOADED_BOOLEAN&&!0===t?Yu(e):Wu(e)+Yu(t)+'"'}if(n)return null==t?"":Wu(e)+Yu(t)+'"';return null};var Gu=bu,Xu=wu,Zu=Au,Ku=Cu,Qu=Fu,eo=Su,to=Ru,no=ku,ro=function(e,t){return Iu(e,t,"-")},io=$u,ao={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},uo=oo;function oo(e,t){return e?(Qu(e)&&(e=e.render()),eo(e)&&e.render&&(e=e.render()),Zu(e)?function(e){var t=e.properties,n="<"+e.tagName.toLowerCase();for(var r in t){var i=t[r];if(null!=i)if("attributes"!=r)if("dataset"!=r){if("style"==r){var a="";for(var u in i=Xu({},i))a+=ro(u)+": "+i[u]+"; ";i=a.trim()}if(i instanceof to||i instanceof no)n+=" "+io(r,i.value,!0);else{var o=io(r,i);o&&(n+=" "+o)}}else for(var s in i=Xu({},i))n+=" "+io("data-"+ro(s),i[s],!0);else for(var l in i=Xu({},i))n+=" "+io(l,i[l],!0)}return n+">"}(e)+function(e){var t=e.properties.innerHTML;if(null!=t)return t;var n="";if(e.children&&e.children.length)for(var r=0,i=e.children.length;r"}(e):Ku(e)?!t||"script"!==t.tagName.toLowerCase()&&"style"!==t.tagName.toLowerCase()?Gu(String(e.text)):String(e.text):""):""}var so="/home/runner/work/plot/plot/ctor/lib/view/browser",lo=I(Object.freeze({__proto__:null,default:{}})),co=lo.readFile;var fo=lo.readFileSync;function ho(e,t){var n;try{n=arguments.length>1?fo(e,t):fo(e)}catch(e){return e}return n}P((function(){var e,t;for(e=[],t=0;t1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),u=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Ts(t)?n.showHidden=t:t&&function(e,t){if(!t||!Ds(t))return e;var n=Object.keys(t),r=n.length;for(;r--;)e[n[r]]=t[n[r]]}(n,t),Ss(n.showHidden)&&(n.showHidden=!1),Ss(n.depth)&&(n.depth=2),Ss(n.colors)&&(n.colors=!1),Ss(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=ws),Es(n,e,n.depth)}function ws(e,t){var n=bs.styles[t];return n?"["+bs.colors[n][0]+"m"+e+"["+bs.colors[n][1]+"m":e}function _s(e,t){return e}function Es(e,t,n){if(e.customInspect&&t&&Bs(t.inspect)&&t.inspect!==bs&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return Fs(r)||(r=Es(e,r,n)),r}var i=function(e,t){if(Ss(t))return e.stylize("undefined","undefined");if(Fs(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"==typeof r)return e.stylize(""+t,"number");var r;if(Ts(t))return e.stylize(""+t,"boolean");if(Cs(t))return e.stylize("null","null")}(e,t);if(i)return i;var a=Object.keys(t),u=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),Os(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return xs(t);if(0===a.length){if(Bs(t)){var o=t.name?": "+t.name:"";return e.stylize("[Function"+o+"]","special")}if(Rs(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(ks(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Os(t))return xs(t)}var s,l,c="",f=!1,h=["{","}"];(s=t,Array.isArray(s)&&(f=!0,h=["[","]"]),Bs(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return Rs(t)&&(c=" "+RegExp.prototype.toString.call(t)),ks(t)&&(c=" "+Date.prototype.toUTCString.call(t)),Os(t)&&(c=" "+xs(t)),0!==a.length||f&&0!=t.length?n<0?Rs(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=f?function(e,t,n,r,i){for(var a=[],u=0,o=t.length;u60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(l,c,h)):h[0]+c+h[1]}function xs(e){return"["+Error.prototype.toString.call(e)+"]"}function As(e,t,n,r,i,a){var u,o,s;if((s=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?o=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(o=e.stylize("[Setter]","special")),Ns(r,i)||(u="["+i+"]"),o||(e.seen.indexOf(s.value)<0?(o=Cs(n)?Es(e,s.value,null):Es(e,s.value,n-1)).indexOf("\n")>-1&&(o=a?o.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+o.split("\n").map((function(e){return" "+e})).join("\n")):o=e.stylize("[Circular]","special")),Ss(u)){if(a&&i.match(/^\d+$/))return o;(u=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+o}function Ts(e){return"boolean"==typeof e}function Cs(e){return null===e}function Fs(e){return"string"==typeof e}function Ss(e){return void 0===e}function Rs(e){return Ds(e)&&"[object RegExp]"===Ms(e)}function Ds(e){return"object"==typeof e&&null!==e}function ks(e){return Ds(e)&&"[object Date]"===Ms(e)}function Os(e){return Ds(e)&&("[object Error]"===Ms(e)||e instanceof Error)}function Bs(e){return"function"==typeof e}function Ms(e){return Object.prototype.toString.call(e)}function Ns(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vs(){this.head=null,this.tail=null,this.length=0}bs.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},bs.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Vs.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Vs.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Vs.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Vs.prototype.clear=function(){this.head=this.tail=null,this.length=0},Vs.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},Vs.prototype.concat=function(e){if(0===this.length)return ln.alloc(0);if(1===this.length)return this.head.data;for(var t=ln.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var Ls=ln.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function js(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Ls(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Is;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Us;break;default:return void(this.write=Ps)}this.charBuffer=new ln(6),this.charReceived=0,this.charLength=0}function Ps(e){return e.toString(this.encoding)}function Is(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Us(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}js.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if((i=t.charCodeAt(r))>=55296&&i<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,r)}return t},js.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},js.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t},qs.ReadableState=Ys;var zs=function(e){if(Ss(ms)&&(ms=es.env.NODE_DEBUG||""),e=e.toUpperCase(),!vs[e])if(new RegExp("\\b"+e+"\\b","i").test(ms)){vs[e]=function(){var t=ds.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else vs[e]=function(){};return vs[e]}("stream");function Ys(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof vl&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Vs,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new js(e.encoding),this.encoding=e.encoding)}function qs(e){if(!(this instanceof qs))return new qs(e);this._readableState=new Ys(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),z.call(this)}function Hs(e,t,n,r,i){var a=function(e,t){var n=null;ln.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(a)e.emit("error",a);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,$s(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else{var s;!t.decoder||i||r||(n=t.decoder.write(n),s=!t.objectMode&&0===n.length),i||(t.reading=!1),s||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&$s(e))),function(e,t){t.readingMore||(t.readingMore=!0,Co(Xs,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=Js?e=Js:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function $s(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(zs("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Co(Gs,e):Gs(e))}function Gs(e){zs("emit readable"),e.emit("readable"),Qs(e)}function Xs(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ea.length?a.length:e;if(u===a.length?i+=a:i+=a.slice(0,e),0===(e-=u)){u===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(u));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=ln.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,u=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,u),0===(e-=u)){u===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(u));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function tl(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Co(nl,t,e))}function nl(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function rl(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return zs("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?tl(this):$s(this),null;if(0===(e=Ws(e,t))&&t.ended)return 0===t.length&&tl(this),null;var r,i=t.needReadable;return zs("need readable",i),(0===t.length||t.length-e0?el(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&tl(this)),null!==r&&this.emit("data",r),r},qs.prototype._read=function(e){this.emit("error",new Error("not implemented"))},qs.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,zs("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?u:l;function a(e){zs("onunpipe"),e===n&&l()}function u(){zs("onend"),e.end()}r.endEmitted?Co(i):n.once("end",i),e.on("unpipe",a);var o=function(e){return function(){var t=e._readableState;zs("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Qs(e))}}(n);e.on("drain",o);var s=!1;function l(){zs("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",o),e.removeListener("error",h),e.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",l),n.removeListener("data",f),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||o()}var c=!1;function f(t){zs("ondata"),c=!1,!1!==e.write(t)||c||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==rl(r.pipes,e))&&!s&&(zs("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,c=!0),n.pause())}function h(t){var n;zs("onerror",t),d(),e.removeListener("error",h),0===(n="error",e.listeners(n).length)&&e.emit("error",t)}function p(){e.removeListener("finish",g),d()}function g(){zs("onfinish"),e.removeListener("close",p),d()}function d(){zs("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",n),r.flowing||(zs("pipe resume"),n.resume()),e},qs.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},ol.prototype._write=function(e,t,n){n(new Error("not implemented"))},ol.prototype._writev=null,ol.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,pl(e,t),n&&(t.finished?Co(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},ps(vl,qs);for(var dl=Object.keys(ol.prototype),yl=0;yle._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var i=new ln(r.length),a=0;ae._pos&&(e.push(new ln(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(n)}e._xhr.readyState===Fl&&"ms-stream"!==e._mode&&e.push(null)},ps(Rl,ol);var Dl=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];Rl.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===Dl.indexOf(n)&&(this._headers[n]={name:e,value:t})},Rl.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},Rl.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},Rl.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,n=e._opts,r=e._headers;if("POST"!==n.method&&"PUT"!==n.method&&"PATCH"!==n.method||(t=function(){if(void 0!==Ko)return Ko;try{new it.Blob([new ArrayBuffer(1)]),Ko=!0}catch(e){Ko=!1}return Ko}()?new it.Blob(e._body.map((function(e){return function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(Jn(e)){for(var t=new Uint8Array(e.length),n=e.length,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Yl=Ol-Bl,ql=Math.floor,Hl=String.fromCharCode;function Jl(e){throw new RangeError(zl[e])}function Wl(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function $l(e,t,n){var r=0;for(e=n?ql(e/Vl):e>>1,e+=ql(e/t);e>Yl*Ml>>1;r+=Ol)e=ql(e/Yl);return ql(r+(Yl+1)*e/(e+Nl))}function Gl(e){return function(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]);var i=function(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}((e=e.replace(Ul,".")).split("."),t).join(".");return r+i}(e,(function(e){return Il.test(e)?"xn--"+function(e){var t,n,r,i,a,u,o,s,l,c,f,h,p,g,d,y=[];for(e=function(e){for(var t,n,r=[],i=0,a=e.length;i=55296&&t<=56319&&i=t&&fql((kl-n)/(p=r+1))&&Jl("overflow"),n+=(o-t)*p,t=o,u=0;ukl&&Jl("overflow"),f==t){for(s=n,l=Ol;!(s<(c=l<=a?Bl:l>=a+Ml?Ml:l-a));l+=Ol)d=s-c,g=Ol-c,y.push(Hl(Wl(c+d%g,0))),s=ql(d/g);y.push(Hl(Wl(s,0))),a=$l(n,p,r==i),n=0,++r}++n,++t}return y.join("")}(e):e}))}function Xl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Zl=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Kl(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Ql(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0&&o>u&&(o=u);for(var s=0;s=0?(l=p.substr(0,g),c=p.substr(g+1)):(l=p,c=""),f=decodeURIComponent(l),h=decodeURIComponent(c),Xl(i,f)?Zl(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}function nc(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}it.URL,it.URLSearchParams;var rc=/^([a-z0-9.+-]+:)/i,ic=/:[0-9]*$/,ac=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uc=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),oc=["'"].concat(uc),sc=["%","/","?",";","#"].concat(oc),lc=["/","?","#"],cc=/^[+a-z0-9A-Z_-]{0,63}$/,fc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hc={javascript:!0,"javascript:":!0},pc={javascript:!0,"javascript:":!0},gc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dc(e,t,n){if(e&&Ds(e)&&e instanceof nc)return e;var r=new nc;return r.parse(e,t,n),r}function yc(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var n=e.protocol||"",r=e.pathname||"",i=e.hash||"",a=!1,u="";e.host?a=t+e.host:e.hostname&&(a=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(a+=":"+e.port)),e.query&&Ds(e.query)&&Object.keys(e.query).length&&(u=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Ql(ec(e),(function(r){var i=encodeURIComponent(Kl(r))+n;return Zl(e[r])?Ql(e[r],(function(e){return i+encodeURIComponent(Kl(e))})).join(t):i+encodeURIComponent(Kl(e[r]))})).join(t):r?encodeURIComponent(Kl(r))+n+encodeURIComponent(Kl(e)):""}(e.query));var o=e.search||u&&"?"+u||"";return n&&":"!==n.substr(-1)&&(n+=":"),e.slashes||(!n||gc[n])&&!1!==a?(a="//"+(a||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):a||(a=""),i&&"#"!==i.charAt(0)&&(i="#"+i),o&&"?"!==o.charAt(0)&&(o="?"+o),n+a+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(o=o.replace("#","%23"))+i}function mc(e){var t=e.host,n=ic.exec(t);n&&(":"!==(n=n[0])&&(e.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(e.hostname=t)}function vc(e,t){"string"==typeof e&&(e=dc(e));var n=-1===it.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||n,i=e.hostname||e.host,a=e.port,u=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(a?":"+a:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var o=new Rl(e);return t&&o.on("response",t),o}function bc(e,t){var n=vc(e,t);return n.end(),n}function wc(){}nc.prototype.parse=function(e,t,n){return function(e,t,n,r){if(!Fs(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),a=-1!==i&&i127?x+="x":x+=E[A];if(!x.match(cc)){var C=_.slice(0,c),F=_.slice(c+1),S=E.match(fc);S&&(C.push(S[1]),F.unshift(S[2])),F.length&&(s="/"+F.join(".")+s),e.hostname=C.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),w||(e.hostname=Gl(e.hostname)),p=e.port?":"+e.port:"";var R=e.hostname||"";e.host=R+p,e.href+=e.host,w&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!hc[d])for(c=0,h=oc.length;c0)&&r.host.split("@"))&&(r.auth=d.shift(),r.host=r.hostname=d.shift())),r.search=e.search,r.query=e.query,Cs(r.pathname)&&Cs(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=w.slice(-1)[0],x=(r.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,A=0,T=w.length;T>=0;T--)"."===(E=w[T])?w.splice(T,1):".."===E?(w.splice(T,1),A++):A&&(w.splice(T,1),A--);if(!v&&!b)for(;A--;A)w.unshift("..");!v||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),x&&"/"!==w.join("/").substr(-1)&&w.push("");var C=""===w[0]||w[0]&&"/"===w[0].charAt(0);return _&&(r.hostname=r.host=C?"":w.length?w.shift():"",(d=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=d.shift(),r.host=r.hostname=d.shift())),(v=v||r.host&&w.length)&&!C&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),Cs(r.pathname)&&Cs(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},nc.prototype.parseHost=function(){return mc(this)},wc.defaultMaxSockets=4;var _c=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Ec={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},xc={request:vc,get:bc,Agent:wc,METHODS:_c,STATUS_CODES:Ec};function Ac(e,t){return Mt(t)?ne(t,"port")&&(e.port=t.port,!Nt(e.port))?new TypeError(D("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","port",e.port)):ne(t,"maxport")&&(e.maxport=t.maxport,!Nt(e.maxport))?new TypeError(D("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","maxport",e.maxport)):ne(t,"hostname")&&(e.hostname=t.hostname,!le(e.hostname))?new TypeError(D("invalid option. `%s` option must be a string. Option: `%s`.","hostname",e.hostname)):ne(t,"address")&&(e.address=t.address,!le(e.address))?new TypeError(D("invalid option. `%s` option must be a string. Option: `%s`.","address",e.address)):null:new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t))}var Tc={port:0,address:"127.0.0.1"},Cc=I(Object.freeze({__proto__:null,Agent:wc,METHODS:_c,STATUS_CODES:Ec,default:xc,get:bc,request:vc})),Fc=G("./../../http-server");var Sc=I(Object.freeze({__proto__:null,default:{}})),Rc=I(ts),Dc=Rc.platform,kc="win32"===Dc,Oc="darwin"===Dc,Bc=/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?[^#]*)?(?:#.*)?/,Mc=/[^a-z0-9:\/?#\[\]@!$&'()*+,;=.\-_~%]/i,Nc=/%[^0-9a-f]/i,Vc=/%[0-9a-f](:?[^0-9a-f]|$)/i,Lc=/^\/\//,jc=/^[a-z][a-z0-9+\-.]*$/;var Pc,Ic,Uc=Sc.spawn;function zc(e){var t,n,r;if(!function(e){var t,n,r,i;return!(!le(e)||Mc.test(e)||Nc.test(e)||Vc.test(e)||(n=(r=e.match(Bc))[1],t=r[2],i=r[3],!(n&&n.length&&jc.test(n.toLowerCase()))||!t&&Lc.test(i)))}(e))throw new TypeError(D("invalid argument. Must provide a valid URI. Value: `%s`.",e));for(t=new Array(Pc.length),r=0;r1){if(!le(t))throw new TypeError(D("invalid argument. Second argument must be a string. Value: `%s`.",t));return Kn.from(e,t)}return Kn.from(e,"utf8")}:function(e,t){if(!le(e))throw new TypeError(D("invalid argument. First argument must be a string. Value: `%s`.",e));if(arguments.length>1){if(!le(t))throw new TypeError(D("invalid argument. Second argument must be a string. Value: `%s`.",t));return new Kn(e,t)}return new Kn(e,"utf8")},qc=Rc;function Hc(e){var t,n;for(t=[],n=1;n1){if(!Ft(u=arguments[1]))throw new TypeError(D("invalid argument. Callback argument must be a function. Value: `%s`.",u))}else u=Ye;if(l=function(e,t){return Mt(t)?!ne(t,"html")||(e.html=t.html,pt(e.html)||le(e.html))?!ne(t,"javascript")||(e.javascript=t.javascript,pt(e.javascript)||le(e.javascript))?ne(t,"open")&&(e.open=t.open,!Xe(e.open))?new TypeError(D("invalid option. `%s` option must be a boolean. Option: `%s`.","open",e.open)):null:new TypeError(D("invalid option. `%s` option must be either a Buffer or a string. Option: `%s`.","javascript",e.javascript)):new TypeError(D("invalid option. `%s` option must be either a Buffer or a string. Option: `%s`.","html",e.html)):new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",t))}(s,e),l)throw l;function c(e){var n=e.remoteAddress+":"+e.remotePort;Wc("Received a socket connection: %s.",n),t[n]=e,e.on("close",(function(){Wc("Socket connection closed: %s.",n),delete t[n]}))}function f(e,t){Wc("Sending HTML..."),t.statusCode=200,t.setHeader("Content-Type","text/html"),t.setHeader("Content-Length",Kn.byteLength(s.html.toString())),t.end(s.html)}function h(e,t){Wc("Sending JavaScript..."),t.statusCode=200,t.setHeader("Content-Type","text/javascript"),t.setHeader("Content-Length",Kn.byteLength(s.javascript.toString())),t.end(s.javascript)}function p(){Wc("Finished serving content."),n=!0,Wc("Closing the server..."),r.close(),setTimeout(g,5e3)}function g(){var e,n;for(Wc("Destroying all connections..."),e=At(t),n=0;n1){if(n=arguments[0],!Ft(e=arguments[1]))throw new TypeError(D("invalid argument. Request listener must be a function. Value: `%s`.",e));o=Ac(i,n)}if(o)throw o;return a=void 0===i.port?Tc.port:i.port,Fc("Server port: %d",a),Fc("Max server port: %d",u=void 0===i.maxport?a:i.maxport),t=i.hostname?i.hostname:i.address?i.address:Tc.address,Fc("Server hostname: %s",t),function(n){var r;if(!Ft(n))throw new TypeError(D("invalid argument. Callback argument must be a function. Value: `%s`.",n));(r=e?Cc.createServer(e):Cc.createServer()).on("error",(function(e){if("EADDRINUSE"===e.code&&(Fc("Server address already in use: %s:%d.",t,a),(a+=1)<=u))return Fc("Attempting to listen on %s:%d.",t,a),void r.listen(a,t);throw e})),r.once("listening",(function(){var e=r.address();Fc("HTTP server initialized. Server is listening for requests on %s:%d.",e.address,e.port),n(null,r)})),Fc("Attempting to listen on %s:%d.",t,a),r.listen(a,t)}}(i,(function(e,t){if(Wc("Received a request for %s",e.url),n)return function(e,t){Wc("Sending 503 response..."),t.statusCode=503,t.end()}(0,t);if("/bundle.js"===e.url)return Hc(r(h)),t.once("finish",p);if("/"!==e.url&&"/index.html"!==e.url)return function(e,t){Wc("Sending 404 response..."),t.statusCode=404,t.end()}(0,t);Hc(r(f)),s.javascript||t.once("finish",p);function r(n){return function(){n(e,t)}}})),Wc("Starting server..."),o((function(e,t){var n;if(e)throw e;Wc("Server started."),(r=t).on("connection",c),r.once("close",d),s.open&&zc("http://"+(n=r.address()).address+":"+n.port);u(null,r)})),t={}}var Gc=mu,Xc=uo;var Zc="/home/runner/work/plot/plot/ctor/lib/view/electron",Kc=Rc.env;function Qc(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ef=Sc.spawn,tf=mu,nf=uo,rf=G("plot:view:electron:main"),af=function(e){try{return Qc(e)}catch(e){return jt(e)?e:"object"==typeof e?new Error(JSON.stringify(e)):new Error(e.toString())}}("@stdlib/electron");function uf(e,t,n){if("none"!==t)return"stdout"===t?function(e){console.log(JSON.stringify(e))}(n):"browser"===t?function(e){var t;t=Xc(e),$c({html:ho(Gc.join(so,"index.html"),{encoding:"utf8"}).replace(/\{\{plot\}\}/,t),open:!0})}(n):void("terminal"!==t&&function(e,t){var n,r,i,a;if(za(af,Error))throw new Error("invalid operation. Unable to load Electron. Ensure Electron is installed and try again.");rf("Transforming virtual DOM tree to HTML..."),r=nf(t),i={encoding:"utf8"},rf("Injecting HTML into HTML template..."),n=(n=ho(n=tf.join(Zc,"index.html"),i)).replace(/\{\{plot\}\}/,r),rf("Injecting CSS into HTML template..."),a=ho(a=tf.join(Zc,"css","reset.css"),i),n=n.replace(/\{\{reset\}\}/,a),a=ho(a=tf.join(Zc,"css","colors.css"),i),n=n.replace(/\{\{colors\}\}/,a),a=ho(a=tf.join(Zc,"css","styles.css"),i),n=n.replace(/\{\{styles\}\}/,a),rf("Creating a disposable HTTP server..."),$c(i={html:n,open:!1},(function(t,n){var r,i,a;if(t)throw t;r=n.address(),rf("HTTP server initialized. Server is listening for requests on %s:%d.",r.address,r.port),rf("Electron executable: %s.",af),a={SERVER_PORT:r.port,SERVER_ADDRESS:r.address,PLOT_WIDTH:e.width,PLOT_HEIGHT:e.height,PLOT_APP_PATH:Zc,PLOT_MIN_WIDTH:100,PLOT_MIN_HEIGHT:100,PLOT_TITLE:e.title||"stdlib"},rf("Electron process environment variables: %s.",JSON.stringify(a)),i={cwd:Zc,detached:!0,stdio:"ignore"},rf("Electron process options: %s.",JSON.stringify(i)),i.env=gi({},ii(Kc),a),rf("Spawning an electron process..."),ef(af,["./main.js"],i).unref()}))}(e,n))}var of=Object.prototype.toString;var sf=new Function("try {return this === global;} catch ( err ) {return false;}")(),lf=Rc,cf=ot(),ff=/node|io\.js/;var hf,pf="object"==typeof it&&it===cf&&cf===cf.global&&("[object global]"===ue(cf)||"[object Object]"===ue(cf))&&!0===sf&&"object"==typeof lf&&"[object process]"===(hf=lf,of.call(hf))&&Mt(lf.versions)&&le(lf.versions.node)&&(void 0===lf.release||Mt(lf.release)&&le(lf.release.name)&&ff.test(lf.release.name));var gf=/^repl$|^$/,df=/at REPLServer/;function yf(){var e,t;if(!pf)return!1;for(t=module;t;){if(gf.test(t.id))return!0;t=t.parent}return!!(e=(new Error).stack)&&df.test(e)}var mf=G("plot:accessor:is-defined");function vf(e){var t=!_e(e);return mf("Datum: %s. Defined: %s.",JSON.stringify(e),t),t}var bf=G("plot:set:x");var wf=G("plot:set:y");var _f=G("plot:set:labels");var Ef=G("plot:set:is-defined");var xf={category10:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcdb22","#17becf"],category20:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],category20b:["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],category20c:["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"]},Af=G("plot:set:colors");var Tf=["-","--",":","-.","none"],Cf=G("plot:set:line-style");function Ff(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length&&Fe(e.length)&&e.length>=0&&e.length<=Oi}function Sf(e){if("function"!=typeof e)throw new TypeError(D("invalid argument. Must provide a function. Value: `%s`.",e));return function(t){var n,r;if(!Ff(t))return!1;if(n=t.length,0===n)return!1;for(r=0;r0}function zf(e){return ve(e)&&e.valueOf()>0}function Yf(e){return Uf(e)||zf(e)}P(Yf,"isPrimitive",Uf),P(Yf,"isObject",zf);var qf=G("plot:set:width");var Hf=G("plot:set:height");var Jf=G("plot:set:padding-left");var Wf=G("plot:set:padding-right");var $f=G("plot:set:padding-top");var Gf=G("plot:set:padding-bottom");function Xf(e){return null===e}var Zf=G("plot:set:x-min");function Kf(e){var t,n;if(0===e.length)return null;for(t=e[0],n=1;nt&&(t=e[n]);return t}var th=G("plot:set:y-min");var nh=G("plot:set:y-max");var rh=G("plot:set:x-scale");function ih(e,t){return et?1:e>=t?0:NaN}function ah(e){return 1===e.length&&(e=function(e){return function(t,n){return ih(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}var uh=ah(ih).right;function oh(e){return null===e?NaN:+e}var sh=Math.sqrt(50),lh=Math.sqrt(10),ch=Math.sqrt(2);function fh(e,t,n){var r,i,a,u,o=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t0)for(e=Math.ceil(e/u),t=Math.floor(t/u),a=new Array(i=Math.ceil(t-e+1));++o=0?(a>=sh?10:a>=lh?5:a>=ch?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=sh?10:a>=lh?5:a>=ch?2:1)}function ph(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=sh?i*=10:a>=lh?i*=5:a>=ch&&(i*=2),t=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),u=+n(e[a],a,e);return u+(+n(e[a+1],a+1,e)-u)*(i-a)}}var dh="$";function yh(){}function mh(e,t){var n=new yh;if(e instanceof yh)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,a=e.length;if(null==t)for(;++i>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wh(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Vh.exec(e))?new Xh(t[1],t[2],t[3],1):(t=Lh.exec(e))?new Xh(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=jh.exec(e))?Wh(t[1],t[2],t[3],t[4]):(t=Ph.exec(e))?Wh(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ih.exec(e))?ep(t[1],t[2]/100,t[3]/100,1):(t=Uh.exec(e))?ep(t[1],t[2]/100,t[3]/100,t[4]):zh.hasOwnProperty(e)?Jh(zh[e]):"transparent"===e?new Xh(NaN,NaN,NaN,0):null}function Jh(e){return new Xh(e>>16&255,e>>8&255,255&e,1)}function Wh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xh(e,t,n,r)}function $h(e){return e instanceof Rh||(e=Hh(e)),e?new Xh((e=e.rgb()).r,e.g,e.b,e.opacity):new Xh}function Gh(e,t,n,r){return 1===arguments.length?$h(e):new Xh(e,t,n,null==r?1:r)}function Xh(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Zh(){return"#"+Qh(this.r)+Qh(this.g)+Qh(this.b)}function Kh(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Qh(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function ep(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new np(e,t,n,r)}function tp(e){if(e instanceof np)return new np(e.h,e.s,e.l,e.opacity);if(e instanceof Rh||(e=Hh(e)),!e)return new np;if(e instanceof np)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),u=NaN,o=a-i,s=(a+i)/2;return o?(u=t===a?(n-r)/o+6*(n0&&s<1?0:u,new np(u,o,s,e.opacity)}function np(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function rp(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Fh(Rh,Hh,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Yh,formatHex:Yh,formatHsl:function(){return tp(this).formatHsl()},formatRgb:qh,toString:qh}),Fh(Xh,Gh,Sh(Rh,{brighter:function(e){return e=null==e?kh:Math.pow(kh,e),new Xh(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Dh:Math.pow(Dh,e),new Xh(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zh,formatHex:Zh,formatRgb:Kh,toString:Kh})),Fh(np,(function(e,t,n,r){return 1===arguments.length?tp(e):new np(e,t,n,null==r?1:r)}),Sh(Rh,{brighter:function(e){return e=null==e?kh:Math.pow(kh,e),new np(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Dh:Math.pow(Dh,e),new np(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Xh(rp(e>=240?e-240:e+120,i,r),rp(e,i,r),rp(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var ip=Math.PI/180,ap=180/Math.PI,up=-.14861,op=1.78277,sp=-.29227,lp=-.90649,cp=1.97294,fp=cp*lp,hp=cp*op,pp=op*sp-lp*up;function gp(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof dp)return new dp(e.h,e.s,e.l,e.opacity);e instanceof Xh||(e=$h(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(pp*r+fp*t-hp*n)/(pp+fp-hp),a=r-i,u=(cp*(n-i)-sp*a)/lp,o=Math.sqrt(u*u+a*a)/(cp*i*(1-i)),s=o?Math.atan2(u,a)*ap-120:NaN;return new dp(s<0?s+360:s,o,i,e.opacity)}(e):new dp(e,t,n,null==r?1:r)}function dp(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function yp(e){return function(){return e}}function mp(e,t){return function(n){return e+n*t}}function vp(e){return 1==(e=+e)?bp:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):yp(isNaN(t)?n:t)}}function bp(e,t){var n=t-e;return n?mp(e,n):yp(isNaN(e)?t:e)}Fh(dp,gp,Sh(Rh,{brighter:function(e){return e=null==e?kh:Math.pow(kh,e),new dp(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Dh:Math.pow(Dh,e),new dp(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*ip,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Xh(255*(t+n*(up*r+op*i)),255*(t+n*(sp*r+lp*i)),255*(t+n*(cp*r)),this.opacity)}}));var wp=function e(t){var n=vp(t);function r(e,t){var r=n((e=Gh(e)).r,(t=Gh(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),u=bp(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=u(t),e+""}}return r.gamma=e,r}(1);function _p(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(n=0;na&&(i=t.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:Ap(n,r)})),a=Fp.lastIndex;return a180||n<-180?n-360*Math.round(n/360):n):yp(isNaN(e)?t:e)}));var Op=kp(bp);function Bp(e){return function(){return e}}function Mp(e){return+e}var Np=[0,1];function Vp(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Bp(t)}function Lp(e,t,n,r){var i=e[0],a=e[1],u=t[0],o=t[1];return a2?jp:Lp,r=i=null,c}function c(t){return(r||(r=n(a,u,s?function(e){return function(t,n){var r=e(t=+t,n=+n);return function(e){return e<=t?0:e>=n?1:r(e)}}}(e):e,o)))(+t)}return c.invert=function(e){return(i||(i=n(u,a,Vp,s?function(e){return function(t,n){var r=e(t=+t,n=+n);return function(e){return e<=0?t:e>=1?n:r(e)}}}(t):t)))(+e)},c.domain=function(e){return arguments.length?(a=_h.call(e,Mp),l()):a.slice()},c.range=function(e){return arguments.length?(u=Eh.call(e),l()):u.slice()},c.rangeRound=function(e){return u=Eh.call(e),o=Dp,l()},c.clamp=function(e){return arguments.length?(s=!!e,l()):s},c.interpolate=function(e){return arguments.length?(o=e,l()):o},l()}function Up(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zp(e){return(e=Up(Math.abs(e)))?e[1]:NaN}var Yp,qp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hp(e){if(!(t=qp.exec(e)))throw new Error("invalid format: "+e);var t;return new Jp({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Jp(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Wp(e,t){var n=Up(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Hp.prototype=Jp.prototype,Jp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var $p={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Wp(100*e,t)},r:Wp,s:function(e,t){var n=Up(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(Yp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return a===u?r:a>u?r+new Array(a-u+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Up(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function Gp(e){return e}var Xp,Zp,Kp,Qp=Array.prototype.map,eg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tg(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Gp:(t=Qp.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,a=[],u=0,o=t[0],s=0;i>0&&o>0&&(s+o+1>r&&(o=Math.max(1,r-s)),a.push(e.substring(i-=o,i+o)),!((s+=o+1)>r));)o=t[u=(u+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",u=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?Gp:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Qp.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=Hp(e)).fill,n=e.align,f=e.sign,h=e.symbol,p=e.zero,g=e.width,d=e.comma,y=e.precision,m=e.trim,v=e.type;"n"===v?(d=!0,v="g"):$p[v]||(void 0===y&&(y=12),m=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w="$"===h?a:/[%p]/.test(v)?s:"",_=$p[v],E=/[defgprs%]/.test(v);function x(e){var i,a,s,h=b,x=w;if("c"===v)x=_(e)+x,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),y),m&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==f&&(A=!1),h=(A?"("===f?f:l:"-"===f||"("===f?"":f)+h,x=("s"===v?eg[8+Yp/3]:"")+x+(A&&"("===f?")":""),E)for(i=-1,a=e.length;++i(s=e.charCodeAt(i))||s>57){x=(46===s?u+e.slice(i+1):e.slice(i))+x,e=e.slice(0,i);break}}d&&!p&&(e=r(e,1/0));var T=h.length+e.length+x.length,C=T>1)+h+e+x+C.slice(T);break;default:e=C+h+e+x}return o(e)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),x.toString=function(){return e+""},x}return{format:f,formatPrefix:function(e,t){var n=f(((e=Hp(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(zp(t)/3))),i=Math.pow(10,-r),a=eg[8+r/3];return function(e){return n(i*e)+a}}}}function ng(e){return Xp=tg(e),Zp=Xp.format,Kp=Xp.formatPrefix,Xp}function rg(e){return Math.max(0,-zp(Math.abs(e)))}function ig(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zp(t)/3)))-zp(Math.abs(e)))}function ag(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zp(t)-zp(e))+1}ng({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var ug=Object.freeze({__proto__:null,FormatSpecifier:Jp,get format(){return Zp},formatDefaultLocale:ng,formatLocale:tg,get formatPrefix(){return Kp},formatSpecifier:Hp,precisionFixed:rg,precisionPrefix:ig,precisionRound:ag});function og(e){var t=e.domain;return e.ticks=function(e){var n=t();return fh(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){return function(e,t,n){var r,i=e[0],a=e[e.length-1],u=ph(i,a,null==t?10:t);switch((n=Hp(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(i),Math.abs(a));return null!=n.precision||isNaN(r=ig(u,o))||(n.precision=r),Kp(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(r=ag(u,Math.max(Math.abs(i),Math.abs(a))))||(n.precision=r-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(r=rg(u))||(n.precision=r-2*("%"===n.type))}return Zp(n)}(t(),e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),a=0,u=i.length-1,o=i[a],s=i[u];return s0?r=hh(o=Math.floor(o/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=hh(o=Math.ceil(o*r)/r,s=Math.floor(s*r)/r,n)),r>0?(i[a]=Math.floor(o/r)*r,i[u]=Math.ceil(s/r)*r,t(i)):r<0&&(i[a]=Math.ceil(o*r)/r,i[u]=Math.floor(s*r)/r,t(i)),e},e}function sg(e,t){var n,r=0,i=(e=e.slice()).length-1,a=e[r],u=e[i];return u0))return o;do{o.push(u=new Date(+n)),t(n,a),e(n)}while(u=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return mg.setTime(+t),vg.setTime(+r),e(mg),e(vg),Math.floor(n(mg,vg))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var wg=bg((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));wg.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?bg((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):wg:null};var _g=wg;wg.range;var Eg=1e3,xg=6e4,Ag=36e5,Tg=864e5,Cg=6048e5,Fg=bg((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*Eg)}),(function(e,t){return(t-e)/Eg}),(function(e){return e.getUTCSeconds()})),Sg=Fg;Fg.range;var Rg=bg((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Eg)}),(function(e,t){e.setTime(+e+t*xg)}),(function(e,t){return(t-e)/xg}),(function(e){return e.getMinutes()})),Dg=Rg;Rg.range;var kg=bg((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Eg-e.getMinutes()*xg)}),(function(e,t){e.setTime(+e+t*Ag)}),(function(e,t){return(t-e)/Ag}),(function(e){return e.getHours()})),Og=kg;kg.range;var Bg=bg((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xg)/Tg}),(function(e){return e.getDate()-1})),Mg=Bg;function Ng(e){return bg((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xg)/Cg}))}Bg.range;var Vg=Ng(0),Lg=Ng(1),jg=Ng(2),Pg=Ng(3),Ig=Ng(4),Ug=Ng(5),zg=Ng(6);Vg.range,Lg.range,jg.range,Pg.range,Ig.range,Ug.range,zg.range;var Yg=bg((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),qg=Yg;Yg.range;var Hg=bg((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Hg.every=function(e){return isFinite(e=Math.floor(e))&&e>0?bg((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Jg=Hg;Hg.range;var Wg=bg((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*xg)}),(function(e,t){return(t-e)/xg}),(function(e){return e.getUTCMinutes()})),$g=Wg;Wg.range;var Gg=bg((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Ag)}),(function(e,t){return(t-e)/Ag}),(function(e){return e.getUTCHours()})),Xg=Gg;Gg.range;var Zg=bg((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Tg}),(function(e){return e.getUTCDate()-1})),Kg=Zg;function Qg(e){return bg((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Cg}))}Zg.range;var ed=Qg(0),td=Qg(1),nd=Qg(2),rd=Qg(3),id=Qg(4),ad=Qg(5),ud=Qg(6);ed.range,td.range,nd.range,rd.range,id.range,ad.range,ud.range;var od=bg((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),sd=od;od.range;var ld=bg((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));ld.every=function(e){return isFinite(e=Math.floor(e))&&e>0?bg((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var cd=ld;function fd(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function hd(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function pd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function gd(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,u=e.shortDays,o=e.months,s=e.shortMonths,l=Cd(i),c=Fd(i),f=Cd(a),h=Fd(a),p=Cd(u),g=Fd(u),d=Cd(o),y=Fd(o),m=Cd(s),v=Fd(s),b={a:function(e){return u[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return o[e.getMonth()]},c:null,d:$d,e:$d,f:Qd,g:cy,G:hy,H:Gd,I:Xd,j:Zd,L:Kd,m:ey,M:ty,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Ny,s:Vy,S:ny,u:ry,U:iy,V:uy,w:oy,W:sy,x:null,X:null,y:ly,Y:fy,Z:py,"%":My},w={a:function(e){return u[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return o[e.getUTCMonth()]},c:null,d:gy,e:gy,f:by,g:Dy,G:Oy,H:dy,I:yy,j:my,L:vy,m:wy,M:_y,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Ny,s:Vy,S:Ey,u:xy,U:Ay,V:Cy,w:Fy,W:Sy,x:null,X:null,y:Ry,Y:ky,Z:By,"%":My},_={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=g[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:jd,e:jd,f:qd,g:Md,G:Bd,H:Id,I:Id,j:Pd,L:Yd,m:Ld,M:Ud,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Vd,Q:Jd,s:Wd,S:zd,u:Rd,U:Dd,V:kd,w:Sd,W:Od,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:Md,Y:Bd,Z:Nd,"%":Hd};function E(e,t){return function(n){var r,i,a,u=[],o=-1,s=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++o53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=hd(pd(a.y,0,1))).getUTCDay(),r=i>4||0===i?td.ceil(r):td(r),r=Kg.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=fd(pd(a.y,0,1))).getDay(),r=i>4||0===i?Lg.ceil(r):Lg(r),r=Mg.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?hd(pd(a.y,0,1)).getUTCDay():fd(pd(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,hd(a)):fd(a)}}function A(e,t,n,r){for(var i,a,u=0,o=t.length,s=n.length;u=s)return-1;if(37===(i=t.charCodeAt(u++))){if(i=t.charAt(u++),!(a=_[i in wd?t.charAt(u++):i])||(r=a(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),w.x=E(n,w),w.X=E(r,w),w.c=E(t,w),{format:function(e){var t=E(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=x(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=E(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=x(e+="",!0);return t.toString=function(){return e},t}}}ld.range;var dd,yd,md,vd,bd,wd={"-":"",_:" ",0:"0"},_d=/^\s*\d+/,Ed=/^%/,xd=/[\\^$*+?|[\]().{}]/g;function Ad(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function Nd(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Vd(e,t,n){var r=_d.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Ld(e,t,n){var r=_d.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jd(e,t,n){var r=_d.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Pd(e,t,n){var r=_d.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Id(e,t,n){var r=_d.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ud(e,t,n){var r=_d.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function zd(e,t,n){var r=_d.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Yd(e,t,n){var r=_d.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function qd(e,t,n){var r=_d.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Hd(e,t,n){var r=Ed.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Jd(e,t,n){var r=_d.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Wd(e,t,n){var r=_d.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function $d(e,t){return Ad(e.getDate(),t,2)}function Gd(e,t){return Ad(e.getHours(),t,2)}function Xd(e,t){return Ad(e.getHours()%12||12,t,2)}function Zd(e,t){return Ad(1+Mg.count(Jg(e),e),t,3)}function Kd(e,t){return Ad(e.getMilliseconds(),t,3)}function Qd(e,t){return Kd(e,t)+"000"}function ey(e,t){return Ad(e.getMonth()+1,t,2)}function ty(e,t){return Ad(e.getMinutes(),t,2)}function ny(e,t){return Ad(e.getSeconds(),t,2)}function ry(e){var t=e.getDay();return 0===t?7:t}function iy(e,t){return Ad(Vg.count(Jg(e)-1,e),t,2)}function ay(e){var t=e.getDay();return t>=4||0===t?Ig(e):Ig.ceil(e)}function uy(e,t){return e=ay(e),Ad(Ig.count(Jg(e),e)+(4===Jg(e).getDay()),t,2)}function oy(e){return e.getDay()}function sy(e,t){return Ad(Lg.count(Jg(e)-1,e),t,2)}function ly(e,t){return Ad(e.getFullYear()%100,t,2)}function cy(e,t){return Ad((e=ay(e)).getFullYear()%100,t,2)}function fy(e,t){return Ad(e.getFullYear()%1e4,t,4)}function hy(e,t){var n=e.getDay();return Ad((e=n>=4||0===n?Ig(e):Ig.ceil(e)).getFullYear()%1e4,t,4)}function py(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ad(t/60|0,"0",2)+Ad(t%60,"0",2)}function gy(e,t){return Ad(e.getUTCDate(),t,2)}function dy(e,t){return Ad(e.getUTCHours(),t,2)}function yy(e,t){return Ad(e.getUTCHours()%12||12,t,2)}function my(e,t){return Ad(1+Kg.count(cd(e),e),t,3)}function vy(e,t){return Ad(e.getUTCMilliseconds(),t,3)}function by(e,t){return vy(e,t)+"000"}function wy(e,t){return Ad(e.getUTCMonth()+1,t,2)}function _y(e,t){return Ad(e.getUTCMinutes(),t,2)}function Ey(e,t){return Ad(e.getUTCSeconds(),t,2)}function xy(e){var t=e.getUTCDay();return 0===t?7:t}function Ay(e,t){return Ad(ed.count(cd(e)-1,e),t,2)}function Ty(e){var t=e.getUTCDay();return t>=4||0===t?id(e):id.ceil(e)}function Cy(e,t){return e=Ty(e),Ad(id.count(cd(e),e)+(4===cd(e).getUTCDay()),t,2)}function Fy(e){return e.getUTCDay()}function Sy(e,t){return Ad(td.count(cd(e)-1,e),t,2)}function Ry(e,t){return Ad(e.getUTCFullYear()%100,t,2)}function Dy(e,t){return Ad((e=Ty(e)).getUTCFullYear()%100,t,2)}function ky(e,t){return Ad(e.getUTCFullYear()%1e4,t,4)}function Oy(e,t){var n=e.getUTCDay();return Ad((e=n>=4||0===n?id(e):id.ceil(e)).getUTCFullYear()%1e4,t,4)}function By(){return"+0000"}function My(){return"%"}function Ny(e){return+e}function Vy(e){return Math.floor(+e/1e3)}function Ly(e){return dd=gd(e),yd=dd.format,md=dd.parse,vd=dd.utcFormat,bd=dd.utcParse,dd}Ly({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var jy="%Y-%m-%dT%H:%M:%S.%LZ";var Py=Date.prototype.toISOString?function(e){return e.toISOString()}:vd(jy),Iy=Py;var Uy=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:bd(jy),zy=Uy,Yy=Object.freeze({__proto__:null,isoFormat:Iy,isoParse:zy,get timeFormat(){return yd},timeFormatDefaultLocale:Ly,timeFormatLocale:gd,get timeParse(){return md},get utcFormat(){return vd},get utcParse(){return bd}}),qy=1e3,Hy=60*qy,Jy=60*Hy,Wy=24*Jy,$y=7*Wy,Gy=30*Wy,Xy=365*Wy;function Zy(e){return new Date(e)}function Ky(e){return e instanceof Date?+e:+new Date(+e)}function Qy(e,t,n,r,i,a,u,o,s){var l=Ip(Vp,Ap),c=l.invert,f=l.domain,h=s(".%L"),p=s(":%S"),g=s("%I:%M"),d=s("%I %p"),y=s("%a %d"),m=s("%b %d"),v=s("%B"),b=s("%Y"),w=[[u,1,qy],[u,5,5*qy],[u,15,15*qy],[u,30,30*qy],[a,1,Hy],[a,5,5*Hy],[a,15,15*Hy],[a,30,30*Hy],[i,1,Jy],[i,3,3*Jy],[i,6,6*Jy],[i,12,12*Jy],[r,1,Wy],[r,2,2*Wy],[n,1,$y],[t,1,Gy],[t,3,3*Gy],[e,1,Xy]];function _(o){return(u(o)1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return sm.h=360*e-100,sm.s=1.5-1.5*t,sm.l=.8-.9*t,sm+""},interpolateViridis:cm,interpolateWarm:um,scaleBand:Th,scaleIdentity:function e(){var t=[0,1];function n(e){return+e}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=_h.call(e,Mp),n):t.slice()},n.copy=function(){return e().domain(t)},og(n)},scaleImplicit:xh,scaleLinear:function e(){var t=Ip(Vp,Ap);return t.copy=function(){return Pp(t,e())},og(t)},scaleLog:function e(){var t=Ip(lg,cg).domain([1,10]),n=t.domain,r=10,i=pg(10),a=hg(10);function u(){return i=pg(r),a=hg(r),n()[0]<0&&(i=gg(i),a=gg(a)),t}return t.base=function(e){return arguments.length?(r=+e,u()):r},t.domain=function(e){return arguments.length?(n(e),u()):n()},t.ticks=function(e){var t,u=n(),o=u[0],s=u[u.length-1];(t=s0){for(;hs)break;d.push(f)}}else for(;h=1;--c)if(!((f=l*c)s)break;d.push(f)}}else d=fh(h,p,Math.min(p-h,g)).map(a);return t?d.reverse():d},t.tickFormat=function(e,n){if(null==n&&(n=10===r?".0e":","),"function"!=typeof n&&(n=Zp(n)),e===1/0)return n;null==e&&(e=10);var u=Math.max(1,r*e/t.ticks().length);return function(e){var t=e/a(Math.round(i(e)));return t*r0?r[i-1]:t[0],i=r?[i[r-1],n]:[i[u-1],i[u]]},u.copy=function(){return e().domain([t,n]).range(a)},og(u)},scaleSequential:function e(t){var n=0,r=1,i=!1;function a(e){var a=(e-n)/(r-n);return t(i?Math.max(0,Math.min(1,a)):a)}return a.domain=function(e){return arguments.length?(n=+e[0],r=+e[1],a):[n,r]},a.clamp=function(e){return arguments.length?(i=!!e,a):i},a.interpolator=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e(t).domain([n,r]).clamp(i)},og(a)},scaleSqrt:function(){return yg().exponent(.5)},scaleThreshold:function e(){var t=[.5],n=[0,1],r=1;function i(e){if(e<=e)return n[uh(t,e,0,r)]}return i.domain=function(e){return arguments.length?(t=Eh.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Eh.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.copy=function(){return e().domain(t).range(n)},i},scaleTime:function(){return Qy(Jg,qg,Vg,Mg,Og,Dg,Sg,_g,yd).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},scaleUtc:function(){return Qy(cd,sd,ed,Kg,Xg,$g,Sg,_g,vd).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},schemeCategory10:tm,schemeCategory20:im,schemeCategory20b:nm,schemeCategory20c:rm}),dm=I(gm),ym=dm.scaleLinear,mm=dm.scaleTime;var vm=G("plot:set:y-scale");var bm=dm.scaleLinear,wm=dm.scaleTime;var _m=G("plot:set:x-tick-format");var Em=I(ug),xm=I(Yy),Am=Em.format,Tm=xm.timeFormat;var Cm=G("plot:set:y-tick-format");var Fm=Em.format,Sm=xm.timeFormat;var Rm=G("plot:set:x-num-ticks");var Dm=G("plot:set:y-num-ticks");var km=["bottom","top"],Om=G("plot:set:x-axis-orient");var Bm=["left","right"],Mm=G("plot:set:y-axis-orient");var Nm=Sf(tt.isPrimitive),Vm=Sf(tt.isObject),Lm=Sf(tt);P(Lm,"primitives",Nm),P(Lm,"objects",Vm);var jm=G("plot:set:x-rug");var Pm=G("plot:set:y-rug");var Im=["bottom","top"],Um=G("plot:set:x-rug-orient");var zm=["left","right"],Ym=G("plot:set:y-rug-orient");var qm=G("plot:set:x-rug-opacity");var Hm=G("plot:set:y-rug-opacity");var Jm=G("plot:set:x-rug-size");var Wm=G("plot:set:y-rug-size");var $m=G("plot:set:description");var Gm=G("plot:set:title");var Xm=G("plot:set:x-label");var Zm=G("plot:set:y-label");var Km=8,Qm=16;var ev=1;function tv(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function nv(e){var t=new Jr(2);return t[0]=e.re,t[1]=e.im,t}function rv(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t||!(!Hi(e)||!Hi(t))&&(n=t,r=nv(e),i=nv(n),tv(r[0],i[0])&&tv(r[1],i[1]));var n,r,i}function iv(e,t,n){var r,i;for(r=function(e){var t=Sa(e);return Ei(e)?Si(t):Ai(t)}(e),i=n;i>>0:a>>>0;(o=i.exec(t))&&!((s=o.index+o[0].length)>h&&(c.push(t.slice(h,o.index)),!r&&o.length>1&&o[0].replace(u,(function(){for(var t=1;t1&&o.index=a));)i.lastIndex===o.index&&i.lastIndex++;return h===t.length?!l&&i.test("")||c.push(""):c.push(t.slice(h)),c.length>a?c.slice(0,a):c},t}(),zv=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,Yv=/^\.|#/,qv=function(e,t){if(!e)return"DIV";var n,r,i,a,u=!t.hasOwnProperty("id"),o=Uv(e,zv),s=null;Yv.test(o[1])&&(s="DIV");for(a=0;a Transform: %s.",t,n),n}}(t):function(e){return function(t){var n="translate(0,"+e(t)+")";return RE("Value: %s => Transform: %s.",t,n),n}}(t)}function kE(e){return"left"===e||"right"===e?"x":"y"}function OE(e){return"left"===e||"right"===e?"y":"x"}var BE=gb,ME=G("axis:components:line"),NE="line";function VE(e){return"top"===e?"0em":"bottom"===e?".71em":".32em"}var LE=gb,jE=G("axis:components:text"),PE="text";var IE=gb,UE=G("axis:components:tick"),zE="g";function YE(e,t,n){var r,i;return i={namespace:"http://www.w3.org/2000/svg",property:"axis.tick",className:"tick",attributes:{opacity:1,transform:n(t)}},r=new Array(2),UE("Rendering a tick line..."),r[0]=function(e){var t,n,r;return t={namespace:"http://www.w3.org/2000/svg",attributes:{stroke:"#aaa","stroke-width":1}},n=kE(e._orientation),r=OE(e._orientation),t.attributes[n+"2"]=e.tickDir*e._innerTickSize,t.attributes[r+"1"]=.5,t.attributes[r+"2"]=.5,ME("Generating a virtual DOM tree (%s) with properties: %s.",NE,JSON.stringify(t)),BE(NE,t,[])}(e),UE("Rendering tick text..."),r[1]=function(e,t){var n,r,i,a,u;return n=e._orientation,jE("Axis orientation: %s.",n),r={namespace:"http://www.w3.org/2000/svg",attributes:{fill:"#000",dy:VE(n)}},a=kE(n),u=OE(n),r.attributes[a]=e.tickDir*e.tickSpacing,r.attributes[u]=.5,i=e.tickFormat(t),jE("Tick text: %s.",i),jE("Generating a virtual DOM tree (%s) with properties: %s.",PE,JSON.stringify(r)),LE(PE,r,i)}(e,t),UE("Generating a virtual DOM tree (%s) with properties: %s.",zE,JSON.stringify(i)),IE(zE,i,r)}var qE=G("axis:components:ticks");function HE(e){return"bottom"===e||"top"===e?"rotate(0)":"left"===e?"rotate(-90)":"rotate(90)"}function JE(e,t){return"left"===e||"right"===e?-t[0]/2:t[1]/2}function WE(e){return"left"===e?-72:"right"===e?72:"bottom"===e?45:-45}var $E=gb,GE=G("axis:components:label"),XE="text";var ZE=gb,KE=G("axis:components:main"),QE="g";function ex(e){var t,n,r;return n={namespace:"http://www.w3.org/2000/svg",property:"axis",className:"axis",attributes:{fill:"none","font-size":10,"font-family":"sans-serif","text-anchor":(r=e._orientation,"left"===r?"end":"right"===r?"start":"middle")}},KE("Rendering tick marks..."),t=function(e){var t,n,r,i;for(n=e.ticks,qE("Tick values: %s.",JSON.stringify(n)),qE("Generating tick transform..."),t=DE(e._orientation,e._scale),qE("Rendering ticks..."),r=new Array(n.length),i=0;i Coordinate: %d",t,n),n}}():e}}),j(ux.prototype,"autoRender",{configurable:!1,enumerable:!0,set:function(e){var t=j_(e);if(t)throw t;xE("Current value: %d.",this._autoRender),this._autoRender=e,xE("New Value: %d.",this._autoRender),this.emit(AE)},get:function(){return this._autoRender}}),Tt(ux.prototype,"render",(function(){var e;return tx("Rendering..."),e=ex(this),this.emit("_render",e),e}));var ox=G("path:accessor:is-defined");function sx(e){var t=!_e(e);return ox("Datum: %s. Defined: %s.",JSON.stringify(e),t),t}var lx={autoRender:!1,color:"#000",isDefined:null,label:"",opacity:.9,style:"-",width:2,x:[],xScale:null,y:[],yScale:null},cx=G("path:set:x");var fx=G("path:set:y");var hx=G("path:set:xscale");var px=G("path:set:yscale");var gx=G("path:set:is-defined");var dx=G("path:set:color");var yx=G("path:set:label");var mx=G("path:set:opacity");var vx=G("path:set:width");var bx=G("path:set:style");var wx=G("path:set:auto-render");var _x=Math.PI,Ex=2*_x,xx=1e-6,Ax=Ex-xx;function Tx(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Cx(){return new Tx}function Fx(e){return function(){return e}}Tx.prototype=Cx.prototype={constructor:Tx,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,u=this._y1,o=n-e,s=r-t,l=a-e,c=u-t,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>xx)if(Math.abs(c*o-s*l)>xx&&i){var h=n-a,p=r-u,g=o*o+s*s,d=h*h+p*p,y=Math.sqrt(g),m=Math.sqrt(f),v=i*Math.tan((_x-Math.acos((g+f-d)/(2*y*m)))/2),b=v/m,w=v/y;Math.abs(b-1)>xx&&(this._+="L"+(e+b*l)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*p)+","+(this._x1=e+w*o)+","+(this._y1=t+w*s)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,a){e=+e,t=+t,a=!!a;var u=(n=+n)*Math.cos(r),o=n*Math.sin(r),s=e+u,l=t+o,c=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>xx||Math.abs(this._y1-l)>xx)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%Ex+Ex),f>Ax?this._+="A"+n+","+n+",0,1,"+c+","+(e-u)+","+(t-o)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>xx&&(this._+="A"+n+","+n+",0,"+ +(f>=_x)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Sx=Math.abs,Rx=Math.atan2,Dx=Math.cos,kx=Math.max,Ox=Math.min,Bx=Math.sin,Mx=Math.sqrt,Nx=1e-12,Vx=Math.PI,Lx=Vx/2,jx=2*Vx;function Px(e){return e>=1?Lx:e<=-1?-Lx:Math.asin(e)}function Ix(e){return e.innerRadius}function Ux(e){return e.outerRadius}function zx(e){return e.startAngle}function Yx(e){return e.endAngle}function qx(e){return e&&e.padAngle}function Hx(e,t,n,r,i,a,u){var o=e-n,s=t-r,l=(u?a:-a)/Mx(o*o+s*s),c=l*s,f=-l*o,h=e+c,p=t+f,g=n+c,d=r+f,y=(h+g)/2,m=(p+d)/2,v=g-h,b=d-p,w=v*v+b*b,_=i-a,E=h*d-g*p,x=(b<0?-1:1)*Mx(kx(0,_*_*w-E*E)),A=(E*b-v*x)/w,T=(-E*v-b*x)/w,C=(E*b+v*x)/w,F=(-E*v+b*x)/w,S=A-y,R=T-m,D=C-y,k=F-m;return S*S+R*R>D*D+k*k&&(A=C,T=F),{cx:A,cy:T,x01:-c,y01:-f,x11:A*(i/_-1),y11:T*(i/_-1)}}function Jx(e){this._context=e}function Wx(e){return new Jx(e)}function $x(e){return e[0]}function Gx(e){return e[1]}function Xx(){var e=$x,t=Gx,n=Fx(!0),r=null,i=Wx,a=null;function u(u){var o,s,l,c=u.length,f=!1;for(null==r&&(a=i(l=Cx())),o=0;o<=c;++o)!(o=c;--f)o.point(y[f],m[f]);o.lineEnd(),o.areaEnd()}d&&(y[l]=+e(h,l,s),m[l]=+n(h,l,s),o.point(t?+t(h,l,s):y[l],r?+r(h,l,s):m[l]))}if(p)return o=null,p+""||null}function l(){return Xx().defined(i).curve(u).context(a)}return s.x=function(n){return arguments.length?(e="function"==typeof n?n:Fx(+n),t=null,s):e},s.x0=function(t){return arguments.length?(e="function"==typeof t?t:Fx(+t),s):e},s.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:Fx(+e),s):t},s.y=function(e){return arguments.length?(n="function"==typeof e?e:Fx(+e),r=null,s):n},s.y0=function(e){return arguments.length?(n="function"==typeof e?e:Fx(+e),s):n},s.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Fx(+e),s):r},s.lineX0=s.lineY0=function(){return l().x(e).y(n)},s.lineY1=function(){return l().x(e).y(r)},s.lineX1=function(){return l().x(t).y(n)},s.defined=function(e){return arguments.length?(i="function"==typeof e?e:Fx(!!e),s):i},s.curve=function(e){return arguments.length?(u=e,null!=a&&(o=u(a)),s):u},s.context=function(e){return arguments.length?(null==e?a=o=null:o=u(a=e),s):a},s}function Kx(e,t){return te?1:t>=e?0:NaN}function Qx(e){return e}Jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var eA=nA(Wx);function tA(e){this._curve=e}function nA(e){function t(t){return new tA(e(t))}return t._curve=e,t}function rA(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(nA(e)):t()._curve},e}function iA(){return rA(Xx().curve(eA))}function aA(){var e=Zx().curve(eA),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return rA(n())},delete e.lineX0,e.lineEndAngle=function(){return rA(r())},delete e.lineX1,e.lineInnerRadius=function(){return rA(i())},delete e.lineY0,e.lineOuterRadius=function(){return rA(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(nA(e)):t()._curve},e}function uA(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}tA.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};var oA=Array.prototype.slice;function sA(e){return e.source}function lA(e){return e.target}function cA(e){var t=sA,n=lA,r=$x,i=Gx,a=null;function u(){var u,o=oA.call(arguments),s=t.apply(this,o),l=n.apply(this,o);if(a||(a=u=Cx()),e(a,+r.apply(this,(o[0]=s,o)),+i.apply(this,o),+r.apply(this,(o[0]=l,o)),+i.apply(this,o)),u)return a=null,u+""||null}return u.source=function(e){return arguments.length?(t=e,u):t},u.target=function(e){return arguments.length?(n=e,u):n},u.x=function(e){return arguments.length?(r="function"==typeof e?e:Fx(+e),u):r},u.y=function(e){return arguments.length?(i="function"==typeof e?e:Fx(+e),u):i},u.context=function(e){return arguments.length?(a=null==e?null:e,u):a},u}function fA(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function hA(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+i)/2,r,n,r,i)}function pA(e,t,n,r,i){var a=uA(t,n),u=uA(t,n=(n+i)/2),o=uA(r,n),s=uA(r,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(u[0],u[1],o[0],o[1],s[0],s[1])}var gA={draw:function(e,t){var n=Math.sqrt(t/Vx);e.moveTo(n,0),e.arc(0,0,n,0,jx)}},dA={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},yA=Math.sqrt(1/3),mA=2*yA,vA={draw:function(e,t){var n=Math.sqrt(t/mA),r=n*yA;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},bA=Math.sin(Vx/10)/Math.sin(7*Vx/10),wA=Math.sin(jx/10)*bA,_A=-Math.cos(jx/10)*bA,EA={draw:function(e,t){var n=Math.sqrt(.8908130915292852*t),r=wA*n,i=_A*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var u=jx*a/5,o=Math.cos(u),s=Math.sin(u);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},xA={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},AA=Math.sqrt(3),TA={draw:function(e,t){var n=-Math.sqrt(t/(3*AA));e.moveTo(0,2*n),e.lineTo(-AA*n,-n),e.lineTo(AA*n,-n),e.closePath()}},CA=-.5,FA=Math.sqrt(3)/2,SA=1/Math.sqrt(12),RA=3*(SA/2+1),DA={draw:function(e,t){var n=Math.sqrt(t/RA),r=n/2,i=n*SA,a=r,u=n*SA+n,o=-a,s=u;e.moveTo(r,i),e.lineTo(a,u),e.lineTo(o,s),e.lineTo(CA*r-FA*i,FA*r+CA*i),e.lineTo(CA*a-FA*u,FA*a+CA*u),e.lineTo(CA*o-FA*s,FA*o+CA*s),e.lineTo(CA*r+FA*i,CA*i-FA*r),e.lineTo(CA*a+FA*u,CA*u-FA*a),e.lineTo(CA*o+FA*s,CA*s-FA*o),e.closePath()}},kA=[gA,dA,vA,xA,EA,TA,DA];function OA(){}function BA(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function MA(e){this._context=e}function NA(e){this._context=e}function VA(e){this._context=e}function LA(e,t){this._basis=new MA(e),this._beta=t}MA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:BA(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:BA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},NA.prototype={areaStart:OA,areaEnd:OA,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:BA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},VA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:BA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},LA.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],a=t[0],u=e[n]-i,o=t[n]-a,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(i+r*u),this._beta*t[s]+(1-this._beta)*(a+r*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var jA=function e(t){function n(e){return 1===t?new MA(e):new LA(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function PA(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function IA(e,t){this._context=e,this._k=(1-t)/6}IA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:PA(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:PA(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var UA=function e(t){function n(e){return new IA(e,t)}return n.tension=function(t){return e(+t)},n}(0);function zA(e,t){this._context=e,this._k=(1-t)/6}zA.prototype={areaStart:OA,areaEnd:OA,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:PA(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var YA=function e(t){function n(e){return new zA(e,t)}return n.tension=function(t){return e(+t)},n}(0);function qA(e,t){this._context=e,this._k=(1-t)/6}qA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:PA(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var HA=function e(t){function n(e){return new qA(e,t)}return n.tension=function(t){return e(+t)},n}(0);function JA(e,t,n){var r=e._x1,i=e._y1,a=e._x2,u=e._y2;if(e._l01_a>Nx){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,s=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/s,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/s}if(e._l23_a>Nx){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/c,u=(u*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,a,u,e._x2,e._y2)}function WA(e,t){this._context=e,this._alpha=t}WA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:JA(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $A=function e(t){function n(e){return t?new WA(e,t):new IA(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function GA(e,t){this._context=e,this._alpha=t}GA.prototype={areaStart:OA,areaEnd:OA,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:JA(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var XA=function e(t){function n(e){return t?new GA(e,t):new zA(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function ZA(e,t){this._context=e,this._alpha=t}ZA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:JA(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var KA=function e(t){function n(e){return t?new ZA(e,t):new qA(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function QA(e){this._context=e}function eT(e){return e<0?-1:1}function tT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),u=(n-e._y1)/(i||r<0&&-0),o=(a*i+u*r)/(r+i);return(eT(a)+eT(u))*Math.min(Math.abs(a),Math.abs(u),.5*Math.abs(o))||0}function nT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function rT(e,t,n){var r=e._x0,i=e._y0,a=e._x1,u=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,u-o*n,a,u)}function iT(e){this._context=e}function aT(e){this._context=new uT(e)}function uT(e){this._context=e}function oT(e){this._context=e}function sT(e){var t,n,r=e.length-1,i=new Array(r),a=new Array(r),u=new Array(r);for(i[0]=0,a[0]=2,u[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(u[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t1)for(var n,r,i,a=1,u=e[t[0]],o=u.length;a=0;)n[t]=t;return n}function hT(e,t){return e[t]}function pT(e){var t=e.map(gT);return fT(e).sort((function(e,n){return t[e]-t[n]}))}function gT(e){for(var t,n=-1,r=0,i=e.length,a=-1/0;++na&&(a=t,r=n);return r}function dT(e){var t=e.map(yT);return fT(e).sort((function(e,n){return t[e]-t[n]}))}function yT(e){for(var t,n=0,r=-1,i=e.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var mT=Object.freeze({__proto__:null,arc:function(){var e=Ix,t=Ux,n=Fx(0),r=null,i=zx,a=Yx,u=qx,o=null;function s(){var s,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),h=i.apply(this,arguments)-Lx,p=a.apply(this,arguments)-Lx,g=Sx(p-h),d=p>h;if(o||(o=s=Cx()),fNx)if(g>jx-Nx)o.moveTo(f*Dx(h),f*Bx(h)),o.arc(0,0,f,h,p,!d),c>Nx&&(o.moveTo(c*Dx(p),c*Bx(p)),o.arc(0,0,c,p,h,d));else{var y,m,v=h,b=p,w=h,_=p,E=g,x=g,A=u.apply(this,arguments)/2,T=A>Nx&&(r?+r.apply(this,arguments):Mx(c*c+f*f)),C=Ox(Sx(f-c)/2,+n.apply(this,arguments)),F=C,S=C;if(T>Nx){var R=Px(T/c*Bx(A)),D=Px(T/f*Bx(A));(E-=2*R)>Nx?(w+=R*=d?1:-1,_-=R):(E=0,w=_=(h+p)/2),(x-=2*D)>Nx?(v+=D*=d?1:-1,b-=D):(x=0,v=b=(h+p)/2)}var k=f*Dx(v),O=f*Bx(v),B=c*Dx(_),M=c*Bx(_);if(C>Nx){var N,V=f*Dx(b),L=f*Bx(b),j=c*Dx(w),P=c*Bx(w);if(g1?0:e<-1?Vx:Math.acos(e)}((I*z+U*Y)/(Mx(I*I+U*U)*Mx(z*z+Y*Y)))/2),H=Mx(N[0]*N[0]+N[1]*N[1]);F=Ox(C,(c-H)/(q-1)),S=Ox(C,(f-H)/(q+1))}}x>Nx?S>Nx?(y=Hx(j,P,k,O,f,S,d),m=Hx(V,L,B,M,f,S,d),o.moveTo(y.cx+y.x01,y.cy+y.y01),SNx&&E>Nx?F>Nx?(y=Hx(B,M,V,L,c,-F,d),m=Hx(k,O,j,P,c,-F,d),o.lineTo(y.cx+y.x01,y.cy+y.y01),F0&&(p+=f);for(null!=t?g.sort((function(e,n){return t(d[e],d[n])})):null!=n&&g.sort((function(e,t){return n(u[e],u[t])})),o=0,l=p?(m-h*b)/p:0;o0?f*l:0)+b,d[s]={data:u[s],index:o,value:f,startAngle:y,endAngle:c,padAngle:v};return d}return u.value=function(t){return arguments.length?(e="function"==typeof t?t:Fx(+t),u):e},u.sortValues=function(e){return arguments.length?(t=e,n=null,u):t},u.sort=function(e){return arguments.length?(n=e,t=null,u):n},u.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Fx(+e),u):r},u.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:Fx(+e),u):i},u.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:Fx(+e),u):a},u},pointRadial:uA,radialArea:aA,radialLine:iA,stack:function(){var e=Fx([]),t=fT,n=cT,r=hT;function i(i){var a,u,o=e.apply(this,arguments),s=i.length,l=o.length,c=new Array(l);for(a=0;a0)for(var n,r,i,a,u,o,s=0,l=e[t[0]].length;s0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=u,r[0]=u+=i):(r[0]=0,r[1]=i)},stackOffsetExpand:function(e,t){if((r=e.length)>0){for(var n,r,i,a=0,u=e[0].length;a0){for(var n,r=0,i=e[t[0]],a=i.length;r0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,a=0,u=1;u1)throw new RangeError(D("invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.","opacity",e));mx("Current value: %d.",this._opacity),this._opacity=e,mx("New Value: %d.",this._opacity),this.emit("change")},get:function(){return this._opacity}}),j(OT.prototype,"width",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","width",e));vx("Current value: %d.",this._width),this._width=e,vx("New Value: %d.",this._width),this.emit("change")},get:function(){return this._width}}),j(OT.prototype,"style",{configurable:!1,enumerable:!0,set:function(e){if(!le(e))throw new TypeError(D("invalid assignment. `%s` must be a string. Value: `%s`.","style",e));bx("Current value: %d.",this._style),this._style=e,bx("New Value: %d.",this._style),this.emit("change")},get:function(){return this._style}}),j(OT.prototype,"autoRender",{configurable:!1,enumerable:!0,set:function(e){if(!Xe(e))throw new TypeError(D("invalid assignment. `%s` must be a boolean. Value: `%s`.","autoRender",e));wx("Current value: %d.",this._autoRender),this._autoRender=e,wx("New Value: %d.",this._autoRender),this.emit("change")},get:function(){return this._autoRender}}),j(OT.prototype,"line",{configurable:!1,enumerable:!0,get:function(){return vT().x(this.xPos).y(this.yPos).defined(this.isDefined)}}),j(OT.prototype,"xPos",{configurable:!1,enumerable:!0,get:function(){var e=this.xScale;return function(t){var n=e(t[0]);return bT("Value: %d => Pixel: %d.",t[0],n),n}}}),j(OT.prototype,"yPos",{configurable:!1,enumerable:!0,get:function(){var e=this.yScale;return function(t){var n=e(t[1]);return wT("Value: %d => Pixel: %d.",t[1],n),n}}}),Tt(OT.prototype,"render",(function(){var e,t;return TT("Rendering..."),e={namespace:"http://www.w3.org/2000/svg",property:"line",className:"path line",attributes:{d:this.line(_T(this._xData,this._yData)),fill:"none",stroke:this.color,"stroke-width":this.width,"stroke-opacity":this.opacity,"stroke-dasharray":xT(this.style),"data-label":this.label}},TT("Generating a virtual DOM tree (%s) with properties: %s.",CT,JSON.stringify(e)),t=AT(CT,e,[]),this.emit("_render",t),t}));var BT=G("symbols:accessor:is-defined");function MT(e){var t=!_e(e);return BT("Datum: %s. Defined: %s.",JSON.stringify(e),t),t}var NT={autoRender:!1,color:"#000",isDefined:null,label:"",opacity:.9,size:6,symbol:"closed-circle",x:[],xScale:null,y:[],yScale:null},VT=["closed-circle","open-circle"],LT=G("symbols:set:symbol");var jT=G("symbols:set:x");var PT=G("symbols:set:y");var IT=G("symbols:set:xscale");var UT=G("symbols:set:yscale");var zT=G("symbols:set:is-defined");var YT=G("symbols:set:size");var qT=G("symbols:set:opacity");var HT=G("symbols:set:color");var JT=G("symbols:set:label");var WT=G("symbols:set:auto-render");var $T=G("symbols:xpos");var GT=G("symbols:ypos");var XT=gb,ZT=G("symbols:render:closed-circles"),KT="circle";var QT=gb,eC=G("symbols:render:open-circles"),tC="circle";var nC=gb,rC=G("symbols:render"),iC={"closed-circle":function(e){var t,n,r,i,a,u,o,s,l,c,f,h,p,g;for(ZT("Rendering closed circles..."),t=e.isDefined,n=e.opacity,r=e.label,i=e.color,u=e.size,o=e.xPos,s=e.yPos,h=e.x,p=e.y,l=[],g=0;g1))throw new RangeError(D("invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.","opacity",e));qT("Current value: %d.",this._opacity),this._opacity=e,qT("New Value: %d.",this._opacity),this.emit("change")},get:function(){var e=this;return ge(this._opacity)?function(){return e._opacity}:this._opacity}}),j(cC.prototype,"color",{configurable:!1,enumerable:!0,set:function(e){if(!le(e)&&!Ft(e))throw new TypeError(D("invalid assignment. `%s` must be a string or a function. Value: `%s`.","color",e));HT("Current value: %d.",this._color),this._color=e,HT("New Value: %d.",this._color),this.emit("change")},get:function(){var e=this;return le(this._color)?function(){return e._color}:this._color}}),j(cC.prototype,"label",{configurable:!1,enumerable:!0,set:function(e){if(!le(e)&&!Ft(e))throw new TypeError(D("invalid assignment. `%s` must be a string or a function. Value: `%s`.","label",e));JT("Current value: %d.",this._label),this._label=e,JT("New Value: %d.",this._label),this.emit("change")},get:function(){var e=this;return le(this._label)?function(){return e._label}:this._label}}),j(cC.prototype,"autoRender",{configurable:!1,enumerable:!0,set:function(e){if(!Xe(e))throw new TypeError(D("invalid assignment. `%s` must be a boolean. Value: `%s`.","autoRender",e));WT("Current value: %d.",this._autoRender),this._autoRender=e,WT("New Value: %d.",this._autoRender),this.emit("change")},get:function(){return this._autoRender}}),j(cC.prototype,"xPos",{configurable:!1,enumerable:!0,get:function(){var e=this.xScale;return function(t){var n=e(t);return $T("Value: %d => Pixel: %d.",t,n),n}}}),j(cC.prototype,"yPos",{configurable:!1,enumerable:!0,get:function(){var e=this.yScale;return function(t){var n=e(t);return GT("Value: %d => Pixel: %d.",t,n),n}}}),Tt(cC.prototype,"render",(function(){var e,t,n;return rC("Rendering..."),t={namespace:"http://www.w3.org/2000/svg",property:"symbols",className:"symbols"},rC("Symbol: %s.",this.symbol),e=(0,iC[this.symbol])(this),rC("Generating a virtual DOM tree (%s) with properties: %s.","g",JSON.stringify(t)),n=nC("g",t,e),this.emit("_render",n),n}));var fC=G("rug:accessor:is-defined");function hC(e){var t=!_e(e);return fC("Datum: %s. Defined: %s.",JSON.stringify(e),t),t}var pC={autoRender:!1,color:"#aaa",data:[],isDefined:null,label:"",opacity:.9,orientation:"bottom",scale:null,size:6},gC=G("rug:set:auto-render");var dC=G("rug:set:color");var yC=G("rug:set:data");var mC=G("rug:set:is-defined");var vC=G("rug:set:label");var bC=G("rug:set:opacity");var wC=["bottom","left","right","top"],_C=G("rug:set:orientation");var EC=G("rug:pos");var xC=G("rug:set:scale");var AC=G("rug:set:size");var TC=gb,CC=G("rug:render:ticks"),FC="line";var SC=gb,RC=G("rug:render");var DC=$.EventEmitter,kC=G,OC=dm.scaleLinear,BC=kC("rug:main"),MC=["_autoRender","_color","_data","_isDefined","_label","_opacity","_orientation","_scale","_size"];function NC(e){var t,n,r,i,a;if(!za(this,NC))return arguments.length?new NC(e):new NC;if(t=this,(r=ii(pC)).isDefined=hC,r.scale=OC(),arguments.length){if(!Mt(e))throw new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",e));r=gi(r,e)}for(BC("Creating an instance with the following configuration: %s.",JSON.stringify(r)),DC.call(this),a=0;a1))throw new RangeError(D("invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.","opacity",e));e!==this._opacity&&(bC("Current value: %d.",this._opacity),this._opacity=e,bC("New Value: %d.",this._opacity),this.emit("change"))},get:function(){var e=this;return ge(this._opacity)?function(){return e._opacity}:this._opacity}}),j(NC.prototype,"orientation",{configurable:!1,enumerable:!0,set:function(e){if(-1===$e(wC,e))throw new TypeError(D('invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.',"orientation",wC.join('", "'),e));e!==this._orientation&&(_C("Current value: %d.",this._orientation),this._orientation=e,_C("New Value: %d.",this._orientation),this.emit("change"))},get:function(){return this._orientation}}),j(NC.prototype,"pos",{configurable:!1,enumerable:!0,get:function(){var e=this.scale;return function(t){var n=e(t);return EC("Value: %d => Pixel: %d.",t,n),n}}}),j(NC.prototype,"scale",{configurable:!1,enumerable:!0,set:function(e){if(!Ft(e))throw new TypeError(D("invalid assignment. `%s` must be a function. Value: `%s`.","scale",e));e!==this._scale&&(xC("Current value: %s.",this._scale),this._scale=e,xC("New Value: %s.",this._scale),this.emit("change"))},get:function(){return this._scale}}),j(NC.prototype,"size",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","size",e));e!==this._size&&(AC("Current value: %d.",this._size),this._size=e,AC("New Value: %d.",this._size),this.emit("change"))},get:function(){return this._size}}),Tt(NC.prototype,"render",(function(){var e,t,n;return RC("Rendering..."),t={namespace:"http://www.w3.org/2000/svg",property:"rug",className:"rug"},e=function(e){var t,n,r,i,a,u,o,s,l,c,f;for(CC("Rendering ticks..."),n=e.data,i=e.pos,o="left"===(f=e.orientation)||"right"===f?"x":"y",s=function(e){return"left"===e||"right"===e?"y":"x"}(e.orientation),a=function(e){return"bottom"===e||"right"===e?-1:1}(e.orientation),r=new Array(n.length),c=0;c2){if(!Mt(arguments[2]))throw new TypeError(D("invalid argument. Options argument must be an object. Value: `%s`.",arguments[2]));(e=ii(arguments[2])).x=arguments[0],e.y=arguments[1]}for(i=JC(i,e),qC("Creating an instance with the following configuration: %s.",JSON.stringify(i)),YC.call(this),u=0;u1)throw new RangeError(D("invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.","lineOpacity",e[t]));Of("Current value: %s.",JSON.stringify(this._lineOpacity)),this._lineOpacity=e,Of("New Value: %s.",JSON.stringify(this._lineOpacity)),this.emit("change")},get:function(){return this._lineOpacity.slice()}}),j(WC.prototype,"lineWidth",{configurable:!1,enumerable:!0,set:function(e){var t=Nt(e);if(!t&&!Bf(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.","lineWidth",e));e=t?[e]:e.slice(),Vf("Current value: %s.",JSON.stringify(this._lineWidth)),this._lineWidth=e,Vf("New Value: %s.",JSON.stringify(this._lineWidth)),this.emit("change")},get:function(){return this._lineWidth.slice()}}),j(WC.prototype,"symbols",{configurable:!1,enumerable:!0,set:function(e){var t,n=le(e);if(!n&&!Vi(e))throw new TypeError(D("invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.","symbols",e));for(e=n?[e]:e.slice(),t=0;t1)throw new RangeError(D("invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.","symbolsOpacity",e[t]));If("Current value: %s.",JSON.stringify(this._symbolsOpacity)),this._symbolsOpacity=e,If("New Value: %s.",JSON.stringify(this._symbolsOpacity)),this.emit("change")},get:function(){return this._symbolsOpacity.slice()}}),j(WC.prototype,"width",{configurable:!1,enumerable:!0,set:function(e){if(!Uf(e))throw new TypeError(D("invalid assignment. `%s` must be a positive number. Value: `%s`.","width",e));e!==this._width&&(qf("Current value: %d.",this._width),this._width=e,qf("New value: %d.",this._width),this.emit("change"))},get:function(){return this._width}}),j(WC.prototype,"height",{configurable:!1,enumerable:!0,set:function(e){if(!Uf(e))throw new TypeError(D("invalid assignment. `%s` must be a positive number. Value: `%s`.","height",e));e!==this._height&&(Hf("Current value: %d.",this._height),this._height=e,Hf("New Value: %d.",this._height),this.emit("change"))},get:function(){return this._height}}),j(WC.prototype,"paddingLeft",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","paddingLeft",e));e!==this._paddingLeft&&(Jf("Current value: %d.",this._paddingLeft),this._paddingLeft=e,Jf("New value: %d.",this._paddingLeft),this.emit("change"))},get:function(){return this._paddingLeft}}),j(WC.prototype,"paddingRight",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","paddingRight",e));e!==this._paddingRight&&(Wf("Current value: %d.",this._paddingRight),this._paddingRight=e,Wf("New value: %d.",this._paddingRight),this.emit("change"))},get:function(){return this._paddingRight}}),j(WC.prototype,"paddingTop",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","paddingTop",e));e!==this._paddingTop&&($f("Current value: %d.",this._paddingTop),this._paddingTop=e,$f("New value: %d.",this._paddingTop),this.emit("change"))},get:function(){return this._paddingTop}}),j(WC.prototype,"paddingBottom",{configurable:!1,enumerable:!0,set:function(e){if(!Nt(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.","paddingBottom",e));e!==this._paddingBottom&&(Gf("Current value: %d.",this._paddingBottom),this._paddingBottom=e,Gf("New value: %d.",this._paddingBottom),this.emit("change"))},get:function(){return this._paddingBottom}}),j(WC.prototype,"xMin",{configurable:!1,enumerable:!0,set:function(e){if(!Xf(e)&&!ge(e))throw new TypeError(D("invalid assignment. `%s` must be a finite number, Date, or null. Value: `%s`.","xMin",e));Zf("Current value: %s.",this._xMin),this._xMin=e,Zf("New value: %s.",this._xMin),this.emit("change")},get:function(){var e;return Xf(this._xMin)?Xf(e=function(e){var t,n;if(0===e.length)return null;for(t=new Array(e.length),n=0;n1)throw new RangeError(D("invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.","xRugOpacity",e[t]));qm("Current value: %s.",JSON.stringify(this._xRugOpacity)),this._xRugOpacity=e,qm("New Value: %s.",JSON.stringify(this._xRugOpacity)),this.emit("change")},get:function(){return this._xRugOpacity.slice()}}),j(WC.prototype,"yRugOpacity",{configurable:!1,enumerable:!0,set:function(e){var t,n=ge(e);if(!n&&!Rf(e))throw new TypeError(D("invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.","yRugOpacity",e));for(e=n?[e]:e.slice(),t=0;t1)throw new RangeError(D("invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.","yRugOpacity",e[t]));Hm("Current value: %s.",JSON.stringify(this._yRugOpacity)),this._yRugOpacity=e,Hm("New Value: %s.",JSON.stringify(this._yRugOpacity)),this.emit("change")},get:function(){return this._yRugOpacity.slice()}}),j(WC.prototype,"xRugSize",{configurable:!1,enumerable:!0,set:function(e){var t=Nt(e);if(!t&&!Bf(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.","xRugSize",e));e=t?[e]:e.slice(),Jm("Current value: %s.",JSON.stringify(this._xRugSize)),this._xRugSize=e,Jm("New Value: %s.",JSON.stringify(this._xRugSize)),this.emit("change")},get:function(){return this._xRugSize.slice()}}),j(WC.prototype,"yRugSize",{configurable:!1,enumerable:!0,set:function(e){var t=Nt(e);if(!t&&!Bf(e))throw new TypeError(D("invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.","yRugSize",e));e=t?[e]:e.slice(),Wm("Current value: %s.",JSON.stringify(this._yRugSize)),this._yRugSize=e,Wm("New Value: %s.",JSON.stringify(this._yRugSize)),this.emit("change")},get:function(){return this._yRugSize.slice()}}),j(WC.prototype,"description",{configurable:!1,enumerable:!0,set:function(e){if(!le(e))throw new TypeError(D("invalid assignment. `%s` must be a string. Value: `%s`.","description",e));e!==this._description&&($m("Current value: %s.",this._description),this._description=e,$m("New value: %s.",this._description),this.emit("change"))},get:function(){return this._description}}),j(WC.prototype,"title",{configurable:!1,enumerable:!0,set:function(e){if(!le(e))throw new TypeError(D("invalid assignment. `%s` must be a string. Value: `%s`.","title",e));e!==this._title&&(Gm("Current value: %s.",this._title),this._title=e,Gm("New value: %s.",this._title),this.emit("change"))},get:function(){return this._title}}),j(WC.prototype,"xLabel",{configurable:!1,enumerable:!0,set:function(e){if(!le(e))throw new TypeError(D("invalid assignment. `%s` must be a string. Value: `%s`.","xLabel",e));e!==this._xLabel&&(Xm("Current value: %s.",this._xLabel),this._xLabel=e,Xm("New value: %s.",this._xLabel),this.emit("change"))},get:function(){return this._xLabel}}),j(WC.prototype,"yLabel",{configurable:!1,enumerable:!0,set:function(e){if(!le(e))throw new TypeError(D("invalid assignment. `%s` must be a string. Value: `%s`.","yLabel",e));e!==this._yLabel&&(Zm("Current value: %s.",this._yLabel),this._yLabel=e,Zm("New value: %s.",this._yLabel),this.emit("change"))},get:function(){return this._yLabel}}),j(WC.prototype,"engine",{configurable:!1,enumerable:!0,set:function(e){if(!function(e,t,n){var r,i;if(r=le(e),!We(e)&&!r)throw new TypeError(D("invalid argument. First argument must be array-like. Value: `%s`.",e));if(arguments.length<2)throw new Error("insufficient arguments. Must provide a search value.");if(arguments.length>2){if(!Re(n))throw new TypeError(D("invalid argument. Third argument must be an integer. Value: `%s`.",n));(i=n)<0&&(i=0)}else i=0;if(r){if(!le(t))throw new TypeError(D("invalid argument. Second argument must be a string. Value: `%s`.",t));return-1!==e.indexOf(t,i)}return-1!==uv(e,t,i)}(ov,e))throw new TypeError(D('invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.',"engine",ov.join('", "'),e));e!==this._engine&&(sv("Current value: %s.",this._engine),this._engine=e,sv("New value: %s.",this._engine),this.emit("change"))},get:function(){return this._engine}}),j(WC.prototype,"autoRender",{configurable:!1,enumerable:!0,set:function(e){if(!Xe(e))throw new TypeError(D("invalid assignment. `%s` must be a boolean. Value: `%s`.","autoRender",e));e!==this._autoRender&&(lv("Current value: %s.",this._autoRender),this._autoRender=e,lv("New Value: %s.",this._autoRender),this.emit("change"))},get:function(){return this._autoRender}}),j(WC.prototype,"renderFormat",{configurable:!1,enumerable:!0,set:function(e){if(-1===$e(cv,e))throw new TypeError(D('invalid assignment. Unrecognized/unsupported `%s`. Must be one of the following: "%s". Value: `%s`.',"format",cv.join('", "'),e));e!==this._renderFormat&&(fv("Current value: %s.",this._renderFormat),this._renderFormat=e,fv("New value: %s.",this._renderFormat),this.emit("change"))},get:function(){return this._renderFormat}}),j(WC.prototype,"viewer",{configurable:!1,enumerable:!0,set:function(e){if(-1===$e(hv,e))throw new TypeError(D("invalid assignment. Unrecognized/unsupported `%s`. Value: `%s`.","viewer",e));e!==this._viewer&&(pv("Current value: %s.",this._viewer),this._viewer=e,pv("New value: %s.",this._viewer),this.emit("change"))},get:function(){return this._viewer}}),j(WC.prototype,"autoView",{configurable:!1,enumerable:!0,set:function(e){if(!Xe(e))throw new TypeError(D("invalid assignment. `%s` must be a boolean. Value: `%s`.","autoView",e));e!==this._autoView&&(gv("Current value: %s.",this._autoView),this._autoView=e,gv("New Value: %s.",this._autoView),this.emit("change"))},get:function(){return this._autoView}}),j(WC.prototype,"graphWidth",{configurable:!1,enumerable:!0,get:function(){return this._width-this._paddingLeft-this._paddingRight}}),j(WC.prototype,"graphHeight",{configurable:!1,enumerable:!0,get:function(){return this._height-this._paddingTop-this._paddingBottom}}),j(WC.prototype,"xDomain",{configurable:!1,enumerable:!0,get:function(){return[this.xMin,this.xMax]}}),j(WC.prototype,"yDomain",{configurable:!1,enumerable:!0,get:function(){return[this.yMin,this.yMax]}}),j(WC.prototype,"xRange",{configurable:!1,enumerable:!0,get:function(){return[0,this.graphWidth]}}),j(WC.prototype,"yRange",{configurable:!1,enumerable:!0,get:function(){return[this.graphHeight,0]}}),j(WC.prototype,"xPos",{configurable:!1,enumerable:!0,get:function(){var e=this.xScale;return function(t){var n=e(t);return dv("Value: %d => Pixel: %d.",t,n),n}}}),j(WC.prototype,"yPos",{configurable:!1,enumerable:!0,get:function(){var e=this.yScale;return function(t){var n=e(t);return yv("Value: %d => Pixel: %d.",t,n),n}}}),Tt(WC.prototype,"render",(function(e){var t,n,r;return n=this.renderFormat,arguments.length?(this.renderFormat=e,r=e):r=n,UC("Validating render state..."),function(e){var t,n,r;if(t=e._xData,n=e._yData,t.length!==n.length)throw new Error(D("invalid state. x and y are different lengths. x length: `%u`. y length: `%u`.",t.length,n.length));for(r=0;r 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from './../../base/format-interpolate';\nimport tokenize from './../../base/format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils/define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils/define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './../../define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasSymbols from './../../has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns \n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils/native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils/native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert/has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Symbol from '@stdlib/symbol/ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn ( nativeClass( value ) === '[object Arguments]' );\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from './main.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment returns the expected internal class of the `arguments` object.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment behaves as expected\n*\n* @example\n* var bool = detect();\n* // returns \n*/\nfunction detect() {\n\treturn isArguments( arguments );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nexport default valueOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from './../../has-tostringtag-support';\nimport nativeClass from '@stdlib/utils/native-class';\nimport test from './try2valueof.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport valueOf from './valueof.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a string.\n*\n* @module @stdlib/assert/is-string\n*\n* @example\n* import isString from '@stdlib/assert/is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* import { isObject as isString } from '@stdlib/assert/is-string';\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* import { isPrimitive as isString } from '@stdlib/assert/is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number/ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from './../../has-tostringtag-support';\nimport nativeClass from '@stdlib/utils/native-class';\nimport Number from '@stdlib/number/ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from './../../is-number';\nimport isNan from '@stdlib/math/base/assert/is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `NaN` number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `NaN` number primitive\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from './../../is-number';\nimport isNan from '@stdlib/math/base/assert/is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value of `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( null );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert/is-number\n*\n* @example\n* import isNumber from '@stdlib/assert/is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert/is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert/is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is `NaN`.\n*\n* @module @stdlib/assert/is-nan\n*\n* @example\n* import isnan from '@stdlib/assert/is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isnan } from '@stdlib/assert/is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns false\n*\n* @example\n* import { isObject as isnan } from '@stdlib/assert/is-nan';\n*\n* var bool = isnan( NaN );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants/float64/pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants/float64/pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants/float64/ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants/float64/ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number/ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from './../../../../base/special/floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants/float64/pinf';\nimport NINF from '@stdlib/constants/float64/ninf';\nimport isInt from '@stdlib/math/base/assert/is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from './../../is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from './../../is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert/is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert/is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert/is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert/is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @private\n* @name isEnumerableProperty\n* @type {Function}\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nvar isEnumerableProperty = Object.prototype.propertyIsEnumerable;\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnum from './native.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment has a bug where String indices are not detected as \"enumerable\" properties. Observed in Node v0.10.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment has the bug\n*/\nfunction detect() {\n\treturn !isEnum.call( 'beep', '0' );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isString from './../../is-string';\nimport { isPrimitive as isnan } from './../../is-nan';\nimport { isPrimitive as isInteger } from './../../is-integer';\nimport isEnum from './native.js';\nimport hasStringEnumBug from './has_string_enumerability_bug.js';\n\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nfunction isEnumerableProperty( value, property ) {\n\tvar bool;\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\tbool = isEnum.call( value, property );\n\tif ( !bool && hasStringEnumBug && isString( value ) ) {\n\t\t// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.\n\t\tproperty = +property;\n\t\treturn (\n\t\t\t!isnan( property ) &&\n\t\t\tisInteger( property ) &&\n\t\t\tproperty >= 0 &&\n\t\t\tproperty < value.length\n\t\t);\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an `arguments` object.\n*\n* @module @stdlib/assert/is-arguments\n*\n* @example\n* import isArguments from '@stdlib/assert/is-arguments';\n*\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* bool = isArguments( [] );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasArgumentsClass from './detect.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isArguments;\nif ( hasArgumentsClass ) {\n\tisArguments = main;\n} else {\n\tisArguments = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants/uint32/max\n* @type {uinteger32}\n*\n* @example\n* import UINT32_MAX from '@stdlib/constants/uint32/max';\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nexport default UINT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from './../../has-own-property';\nimport isEnumerableProperty from './../../is-enumerable-property';\nimport isArray from './../../is-array';\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport MAX_LENGTH from '@stdlib/constants/uint32/max';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\t!isArray( value ) &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH &&\n\t\thasOwnProp( value, 'callee' ) &&\n\t\t!isEnumerableProperty( value, 'callee' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from '@stdlib/assert/is-arguments';\nimport builtin from './builtin.js';\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from './../../../is-array';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* import isOdd from '@stdlib/assert/is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arrayfcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObjectLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nexport default noop;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is object-like.\n*\n* @module @stdlib/assert/is-object-like\n*\n* @example\n* import isObjectLike from '@stdlib/assert/is-object-like';\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* import { isObjectLikeArray as isObjectLike } from '@stdlib/assert/is-object-like';\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport arrayfun from './../../tools/array-function';\nimport main from './main.js';\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert/is-enumerable-property';\nimport noop from './../../noop';\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert/is-enumerable-property';\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants/array/max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants/array/max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport MAX_LENGTH from '@stdlib/constants/array/max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/assert/is-nan';\nimport isCollection from '@stdlib/assert/is-collection';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { isPrimitive as isInteger } from '@stdlib/assert/is-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nexport default RE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a boolean primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean primitive\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns false\n*/\nfunction isBoolean( value ) {\n\treturn ( typeof value === 'boolean' );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean.\n*\n* @name Boolean\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {(boolean|Boolean)} boolean\n*\n* @example\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var b = new Boolean( false );\n* // returns \n*/\nvar Bool = Boolean; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Boolean.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from './../../has-tostringtag-support';\nimport nativeClass from '@stdlib/utils/native-class';\nimport Boolean from '@stdlib/boolean/ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean object\n*\n* @example\n* var bool = isBoolean( true );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Boolean ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Boolean]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a boolean\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a boolean.\n*\n* @module @stdlib/assert/is-boolean\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n* import isBoolean from '@stdlib/assert/is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n* import { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( true ) );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n* import { isObject as isBoolean } from '@stdlib/assert/is-boolean';\n*\n* var bool = isBoolean( true );\n* // returns false\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof global === 'object' ) ? global : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\nimport getThis from './codegen.js';\nimport Self from './self.js';\nimport Win from './window.js';\nimport Global from './global.js';\nimport GlobalThis from './global_this.js';\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: Node.js\n\tif ( Global ) {\n\t\treturn Global;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getGlobal from './../../../global';\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nexport default nodeList;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nexport default reFunctionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reFunctionName from './main.js';\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nexport default RE_FUNCTION_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from './../../is-object-like';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from './../../native-class';\nimport { REGEXP as RE } from '@stdlib/regexp/function-name';\nimport isBuffer from '@stdlib/assert/is-buffer';\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nexport default constructorName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp/function-name\n*\n* @example\n* import reFunctionName from '@stdlib/regexp/function-name';\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils/type-of\n*\n* @example\n* import typeOf from '@stdlib/utils/type-of';\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nimport usePolyfill from './check.js';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport RE from './fixtures/re.js';\nimport nodeList from './fixtures/nodelist.js';\nimport typedarray from './fixtures/typedarray.js';\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from './../../constructor-name';\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from './../../constructor-name';\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nexport default isConstructorPrototype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport indexOf from './../../index-of';\nimport typeOf from './../../type-of';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport EXCLUDED_KEYS from './excluded_keys.json';\nimport win from './window.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nexport default w;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasArgumentsBug from './has_arguments_bug.js';\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport wrapper from './builtin_wrapper.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport keys from './builtin.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from '@stdlib/assert/is-object-like';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport isArguments from '@stdlib/assert/is-arguments';\nimport HAS_ENUM_PROTO_BUG from './has_enumerable_prototype_bug.js';\nimport HAS_NON_ENUM_PROPS_BUG from './has_non_enumerable_properties_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype_wrapper.js';\nimport NON_ENUMERABLE from './non_enumerable.json';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasAutomationEqualityBug from './has_automation_equality_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport HAS_WINDOW from './has_window.js';\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrapper;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './../../define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from './../../is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport typeOf from '@stdlib/utils/type-of';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nexport default isFunction;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object.\n*\n* @name Object\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {Object} object\n*\n* @example\n* var o = new Object( null );\n* // returns {}\n*\n* @example\n* var o = new Object( 5.0 );\n* // returns \n*\n* @example\n* var o = new Object( 'beep' );\n* // returns \n*\n* @example\n* var o1 = {};\n*\n* var o2 = new Object( o1 );\n* // returns {}\n*\n* var bool = ( o1 === o2 );\n* // returns true\n*/\nvar Obj = Object; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from './../../native-class';\nimport Object from '@stdlib/object/ctor';\nimport getProto from './proto.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Object from '@stdlib/object/ctor';\nimport getProto from './detect.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from './../../is-object';\nimport isFunction from './../../is-function';\nimport getPrototypeOf from '@stdlib/utils/get-prototype-of';\nimport hasOwnProp from './../../has-own-property';\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar objectPrototype = Object.prototype;\n\n\n// FUNCTIONS //\n\n/**\n* Tests that an object only has own properties.\n*\n* @private\n* @param {Object} obj - value to test\n* @returns {boolean} boolean indicating if an object only has own properties\n*/\nfunction ownProps( obj ) {\n\tvar key;\n\n\t// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).\n\tfor ( key in obj ) {\n\t\tif ( !hasOwnProp( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// MAIN //\n\n/**\n* Tests if a value is a plain object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a plain object\n*\n* @example\n* var bool = isPlainObject( {} );\n* // returns true\n*\n* @example\n* var bool = isPlainObject( null );\n* // returns false\n*/\nfunction isPlainObject( value ) {\n\tvar proto;\n\n\t// Screen for obvious non-objects...\n\tif ( !isObject( value ) ) {\n\t\treturn false;\n\t}\n\t// Objects with no prototype (e.g., `Object.create( null )`) are plain...\n\tproto = getPrototypeOf( value );\n\tif ( !proto ) {\n\t\treturn true;\n\t}\n\t// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...\n\treturn (\n\t\t// Cannot have own `constructor` property:\n\t\t!hasOwnProp( value, 'constructor' ) &&\n\n\t\t// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):\n\t\thasOwnProp( proto, 'constructor' ) &&\n\t\tisFunction( proto.constructor ) &&\n\t\tnativeClass( proto.constructor ) === '[object Function]' &&\n\n\t\t// Test for object-specific method:\n\t\thasOwnProp( proto, 'isPrototypeOf' ) &&\n\t\tisFunction( proto.isPrototypeOf ) &&\n\n\t\t(\n\t\t\t// Test if the prototype matches the global `Object` prototype (same realm):\n\t\t\tproto === objectPrototype ||\n\n\t\t\t// Test that all properties are own properties (cross-realm; *most* likely a plain object):\n\t\t\townProps( value )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPlainObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from './../../is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from './../../is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getPrototypeOf from '@stdlib/utils/get-prototype-of';\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an `Error` object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `Error` object\n*\n* @example\n* var bool = isError( new Error( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isError( {} );\n* // returns false\n*/\nfunction isError( value ) {\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for `Error` objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tif ( value instanceof Error ) {\n\t\treturn true;\n\t}\n\t// Walk the prototype tree until we find an object having the desired native class...\n\twhile ( value ) {\n\t\tif ( nativeClass( value ) === '[object Error]' ) {\n\t\t\treturn true;\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isError;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to parse a regular expression string.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_REGEXP = reRegExp();\n*\n* var bool = RE_REGEXP.test( '/^beep$/' );\n* // returns true\n*\n* bool = RE_REGEXP.test( '' );\n* // returns false\n*/\nfunction reRegExp() {\n\treturn /^\\/((?:\\\\\\/|[^\\/])+)\\/([imgy]*)$/; // eslint-disable-line no-useless-escape\n}\n\n\n// EXPORTS //\n\nexport default reRegExp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert/is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert/is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a regular expression to parse a regular expression string.\n*\n* @module @stdlib/regexp/regexp\n*\n* @example\n* import reRegExp from '@stdlib/regexp/regexp';\n*\n* var RE_REGEXP = reRegExp();\n*\n* var bool = RE_REGEXP.test( '/^beep$/' );\n* // returns true\n*\n* bool = RE_REGEXP.test( '' );\n* // returns false\n*\n* @example\n* import reRegExp from '@stdlib/regexp/regexp';\n*\n* var RE_REGEXP = reRegExp();\n*\n* var parts = RE_REGEXP.exec( '/^.*$/ig' );\n* // returns [ '/^.*$/ig', '^.*$', 'ig', 'index': 0, 'input': '/^.*$/ig' ]\n*/\n\n// MAIN //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/property-names\n*\n* @example\n* import getOwnPropertyNames from '@stdlib/utils/property-names';\n*\n* var keys = getOwnPropertyNames({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Object from '@stdlib/object/ctor';\n\n\n// VARIABLES //\n\nvar propertyNames = Object.getOwnPropertyNames;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn propertyNames( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default getOwnPropertyNames;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Object from '@stdlib/object/ctor';\nimport keys from './../../keys';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default getOwnPropertyNames;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's own property.\n*\n* @module @stdlib/utils/property-descriptor\n*\n* @example\n* import getOwnPropertyDescriptor from '@stdlib/utils/property-descriptor';\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var keys = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}\n*/\n\n// MODULES //\n\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar propertyDescriptor = Object.getOwnPropertyDescriptor;\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tvar desc;\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\tdesc = propertyDescriptor( value, property );\n\treturn ( desc === void 0 ) ? null : desc;\n}\n\n\n// EXPORTS //\n\nexport default getOwnPropertyDescriptor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert/has-own-property';\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tif ( hasOwnProp( value, property ) ) {\n\t\treturn {\n\t\t\t'configurable': true,\n\t\t\t'enumerable': true,\n\t\t\t'writable': true,\n\t\t\t'value': value[ property ]\n\t\t};\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getOwnPropertyDescriptor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Buffer constructor.\n*\n* @module @stdlib/buffer/ctor\n*\n* @example\n* import ctor from '@stdlib/buffer/ctor';\n*\n* var b = new ctor( [ 1, 2, 3, 4 ] );\n* // returns \n*/\n\n// MODULES //\n\nimport hasNodeBufferSupport from '@stdlib/assert/has-node-buffer-support';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasNodeBufferSupport() ) {\n\tctor = main;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = require( 'buffer' ).Buffer; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from './../../is-buffer';\nimport GlobalBuffer from './buffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Buffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Buffer` support\n*\n* @example\n* var bool = hasNodeBufferSupport();\n* // returns \n*/\nfunction hasNodeBufferSupport() {\n\tvar bool;\n\tvar b;\n\n\tif ( typeof GlobalBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tif ( typeof GlobalBuffer.from === 'function' ) {\n\t\t\tb = GlobalBuffer.from( [ 1, 2, 3, 4 ] );\n\t\t} else {\n\t\t\tb = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)\n\t\t}\n\t\tbool = (\n\t\t\tisBuffer( b ) &&\n\t\t\tb[ 0 ] === 1 &&\n\t\t\tb[ 1 ] === 2 &&\n\t\t\tb[ 2 ] === 3 &&\n\t\t\tb[ 3 ] === 4\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasNodeBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write (browser) polyfill\n\n// MAIN //\n\n/**\n* Buffer constructor.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Copy buffer data to a new `Buffer` instance.\n*\n* @module @stdlib/buffer/from-buffer\n*\n* @example\n* import fromArray from '@stdlib/buffer/from-array';\n* import copyBuffer from '@stdlib/buffer/from-buffer';\n*\n* var b1 = fromArray( [ 1, 2, 3, 4 ] );\n* // returns \n*\n* var b2 = copyBuffer( b1 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFrom from './has_from.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar copyBuffer;\nif ( hasFrom ) {\n\tcopyBuffer = main;\n} else {\n\tcopyBuffer = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default copyBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\nvar bool = isFunction( Buffer.from );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport format from '@stdlib/string/format';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\n/**\n* Copies buffer data to a new `Buffer` instance.\n*\n* @param {Buffer} buffer - buffer from which to copy\n* @throws {TypeError} must provide a `Buffer` instance\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* import fromArray from '@stdlib/buffer/from-array';\n*\n* var b1 = fromArray( [ 1, 2, 3, 4 ] );\n* // returns \n*\n* var b2 = fromBuffer( b1 );\n* // returns \n*/\nfunction fromBuffer( buffer ) {\n\tif ( !isBuffer( buffer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a Buffer. Value: `%s`.', buffer ) );\n\t}\n\treturn Buffer.from( buffer );\n}\n\n\n// EXPORTS //\n\nexport default fromBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport format from '@stdlib/string/format';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\n/**\n* Copies buffer data to a new `Buffer` instance.\n*\n* @param {Buffer} buffer - buffer from which to copy\n* @throws {TypeError} must provide a `Buffer` instance\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* import fromArray from '@stdlib/buffer/from-array';\n*\n* var b1 = fromArray( [ 1, 2, 3, 4 ] );\n* // returns \n*\n* var b2 = fromBuffer( b1 );\n* // returns \n*/\nfunction fromBuffer( buffer ) {\n\tif ( !isBuffer( buffer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a Buffer. Value: `%s`.', buffer ) );\n\t}\n\treturn new Buffer( buffer ); // eslint-disable-line no-buffer-constructor\n}\n\n\n// EXPORTS //\n\nexport default fromBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* import Int8Array from '@stdlib/array/int8';\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 8-bit integer.\n*\n* @module @stdlib/constants/int8/max\n* @type {integer32}\n*\n* @example\n* import INT8_MAX from '@stdlib/constants/int8/max';\n* // returns 127\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* 2^{7} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 127\n*/\nvar INT8_MAX = 127|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int8\n*\n* @example\n* import ctor from '@stdlib/array/int8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt8ArraySupport from '@stdlib/assert/has-int8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt8Array from './../../is-int8array';\nimport INT8_MAX from '@stdlib/constants/int8/max';\nimport INT8_MIN from '@stdlib/constants/int8/min';\nimport GlobalInt8Array from './int8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns \n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants/int8/min\n* @type {integer32}\n*\n* @example\n* import INT8_MIN from '@stdlib/constants/int8/min';\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* import Uint8Array from '@stdlib/array/uint8';\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* @module @stdlib/constants/uint8/max\n* @type {integer32}\n*\n* @example\n* import UINT8_MAX from '@stdlib/constants/uint8/max';\n* // returns 255\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{8} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 255\n*/\nvar UINT8_MAX = 255|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint8\n*\n* @example\n* import ctor from '@stdlib/array/uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert/has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8Array from './../../is-uint8array';\nimport UINT8_MAX from '@stdlib/constants/uint8/max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array/uint8c';\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8ClampedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array/uint8c\n*\n* @example\n* import ctor from '@stdlib/array/uint8c';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ClampedArraySupport from '@stdlib/assert/has-uint8clampedarray-support'; // eslint-disable-line id-length\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8ClampedArray from './../../is-uint8clampedarray';\nimport GlobalUint8ClampedArray from './uint8clampedarray.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns \n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ClampedArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* import Int16Array from '@stdlib/array/int16';\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 16-bit integer.\n*\n* @module @stdlib/constants/int16/max\n* @type {integer32}\n*\n* @example\n* import INT16_MAX from '@stdlib/constants/int16/max';\n* // returns 32767\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{15} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 32767\n*/\nvar INT16_MAX = 32767|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int16\n*\n* @example\n* import ctor from '@stdlib/array/int16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt16ArraySupport from '@stdlib/assert/has-int16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt16Array from './../../is-int16array';\nimport INT16_MAX from '@stdlib/constants/int16/max';\nimport INT16_MIN from '@stdlib/constants/int16/min';\nimport GlobalInt16Array from './int16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants/int16/min\n* @type {integer32}\n*\n* @example\n* import INT16_MIN from '@stdlib/constants/int16/min';\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* import Uint16Array from '@stdlib/array/uint16';\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* @module @stdlib/constants/uint16/max\n* @type {integer32}\n*\n* @example\n* import UINT16_MAX from '@stdlib/constants/uint16/max';\n* // returns 65535\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{16} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 1111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 65535\n*/\nvar UINT16_MAX = 65535|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint16\n*\n* @example\n* import ctor from '@stdlib/array/uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert/has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint16Array from './../../is-uint16array';\nimport UINT16_MAX from '@stdlib/constants/uint16/max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* import Int32Array from '@stdlib/array/int32';\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 32-bit integer.\n*\n* @module @stdlib/constants/int32/max\n* @type {integer32}\n*\n* @example\n* import INT32_MAX from '@stdlib/constants/int32/max';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{31} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 2147483647\n*/\nvar INT32_MAX = 2147483647|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int32\n*\n* @example\n* import ctor from '@stdlib/array/int32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt32ArraySupport from '@stdlib/assert/has-int32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt32Array from './../../is-int32array';\nimport INT32_MAX from '@stdlib/constants/int32/max';\nimport INT32_MIN from '@stdlib/constants/int32/min';\nimport GlobalInt32Array from './int32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns \n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants/int32/min\n* @type {integer32}\n*\n* @example\n* import INT32_MIN from '@stdlib/constants/int32/min';\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* import Uint32Array from '@stdlib/array/uint32';\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint32\n*\n* @example\n* import ctor from '@stdlib/array/uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert/has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint32Array from './../../is-uint32array';\nimport UINT32_MAX from '@stdlib/constants/uint32/max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasFloat32Array = ( typeof Float32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float32Array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat32Array( [] );\n* // returns false\n*/\nfunction isFloat32Array( value ) {\n\treturn (\n\t\t( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float32\n*\n* @example\n* import ctor from '@stdlib/array/float32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat32ArraySupport from '@stdlib/assert/has-float32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat32Array from './../../is-float32array';\nimport PINF from '@stdlib/constants/float64/pinf';\nimport GlobalFloat32Array from './float32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float32Array` support\n*\n* @example\n* var bool = hasFloat32ArraySupport();\n* // returns \n*/\nfunction hasFloat32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );\n\t\tbool = (\n\t\t\tisFloat32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.140000104904175 &&\n\t\t\tarr[ 2 ] === -3.140000104904175 &&\n\t\t\tarr[ 3 ] === PINF\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat64Array from './../../is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float64\n*\n* @example\n* import ctor from '@stdlib/array/float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert/has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array/int8';\nimport Uint8Array from '@stdlib/array/uint8';\nimport Uint8ClampedArray from '@stdlib/array/uint8c';\nimport Int16Array from '@stdlib/array/int16';\nimport Uint16Array from '@stdlib/array/uint16';\nimport Int32Array from '@stdlib/array/int32';\nimport Uint32Array from '@stdlib/array/uint32';\nimport Float32Array from '@stdlib/array/float32';\nimport Float64Array from '@stdlib/array/float64';\n\n\n// VARIABLES //\n\nvar hash;\n\n\n// FUNCTIONS //\n\n/**\n* Copies an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - array to copy\n* @returns {Int8Array} new array\n*/\nfunction int8array( arr ) {\n\treturn new Int8Array( arr );\n}\n\n/**\n* Copies a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - array to copy\n* @returns {Uint8Array} new array\n*/\nfunction uint8array( arr ) {\n\treturn new Uint8Array( arr );\n}\n\n/**\n* Copies a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - array to copy\n* @returns {Uint8ClampedArray} new array\n*/\nfunction uint8clampedarray( arr ) {\n\treturn new Uint8ClampedArray( arr );\n}\n\n/**\n* Copies an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - array to copy\n* @returns {Int16Array} new array\n*/\nfunction int16array( arr ) {\n\treturn new Int16Array( arr );\n}\n\n/**\n* Copies a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - array to copy\n* @returns {Uint16Array} new array\n*/\nfunction uint16array( arr ) {\n\treturn new Uint16Array( arr );\n}\n\n/**\n* Copies an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - array to copy\n* @returns {Int32Array} new array\n*/\nfunction int32array( arr ) {\n\treturn new Int32Array( arr );\n}\n\n/**\n* Copies a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - array to copy\n* @returns {Uint32Array} new array\n*/\nfunction uint32array( arr ) {\n\treturn new Uint32Array( arr );\n}\n\n/**\n* Copies a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - array to copy\n* @returns {Float32Array} new array\n*/\nfunction float32array( arr ) {\n\treturn new Float32Array( arr );\n}\n\n/**\n* Copies a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - array to copy\n* @returns {Float64Array} new array\n*/\nfunction float64array( arr ) {\n\treturn new Float64Array( arr );\n}\n\n/**\n* Returns a hash of functions for copying typed arrays.\n*\n* @private\n* @returns {Object} function hash\n*/\nfunction typedarrays() {\n\tvar out = {\n\t\t'int8array': int8array,\n\t\t'uint8array': uint8array,\n\t\t'uint8clampedarray': uint8clampedarray,\n\t\t'int16array': int16array,\n\t\t'uint16array': uint16array,\n\t\t'int32array': int32array,\n\t\t'uint32array': uint32array,\n\t\t'float32array': float32array,\n\t\t'float64array': float64array\n\t};\n\treturn out;\n}\n\n\n// MAIN //\n\nhash = typedarrays();\n\n\n// EXPORTS //\n\nexport default hash;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport isArray from '@stdlib/assert/is-array';\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport isError from '@stdlib/assert/is-error';\nimport typeOf from './../../type-of';\nimport regexp from './../../regexp-from-string';\nimport indexOf from './../../index-of';\nimport objectKeys from './../../keys';\nimport propertyNames from './../../property-names';\nimport propertyDescriptor from './../../property-descriptor';\nimport getPrototypeOf from './../../get-prototype-of';\nimport defineProperty from './../../define-property';\nimport copyBuffer from '@stdlib/buffer/from-buffer';\nimport typedArrays from './typed_arrays.js';\n\n\n// FUNCTIONS //\n\n/**\n* Clones a class instance.\n*\n* ## Notes\n*\n* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.\n* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.\n*\n* @private\n* @param {Object} val - class instance\n* @returns {Object} new instance\n*/\nfunction cloneInstance( val ) {\n\tvar cache;\n\tvar names;\n\tvar name;\n\tvar refs;\n\tvar desc;\n\tvar tmp;\n\tvar ref;\n\tvar i;\n\n\tcache = [];\n\trefs = [];\n\n\tref = Object.create( getPrototypeOf( val ) );\n\tcache.push( val );\n\trefs.push( ref );\n\n\tnames = propertyNames( val );\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tname = names[ i ];\n\t\tdesc = propertyDescriptor( val, name );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( val[name] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( val[name], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( ref, name, desc );\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( ref );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( ref );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( ref );\n\t}\n\treturn ref;\n}\n\n/**\n* Copies an error object.\n*\n* @private\n* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy\n* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy\n*\n* @example\n* var err1 = new TypeError( 'beep' );\n*\n* var err2 = copyError( err1 );\n* // returns \n*/\nfunction copyError( error ) {\n\tvar cache = [];\n\tvar refs = [];\n\tvar keys;\n\tvar desc;\n\tvar tmp;\n\tvar key;\n\tvar err;\n\tvar i;\n\n\t// Create a new error...\n\terr = new error.constructor( error.message );\n\n\tcache.push( error );\n\trefs.push( err );\n\n\t// If a `stack` property is present, copy it over...\n\tif ( error.stack ) {\n\t\terr.stack = error.stack;\n\t}\n\t// Node.js specific (system errors)...\n\tif ( error.code ) {\n\t\terr.code = error.code;\n\t}\n\tif ( error.errno ) {\n\t\terr.errno = error.errno;\n\t}\n\tif ( error.syscall ) {\n\t\terr.syscall = error.syscall;\n\t}\n\t// Any enumerable properties...\n\tkeys = objectKeys( error );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tdesc = propertyDescriptor( error, key );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( error[ key ] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( err, key, desc );\n\t}\n\treturn err;\n}\n\n\n// MAIN //\n\n/**\n* Recursively performs a deep copy of an input object.\n*\n* @private\n* @param {*} val - value to copy\n* @param {(Array|Object)} copy - copy\n* @param {Array} cache - an array of visited objects\n* @param {Array} refs - an array of object references\n* @param {NonNegativeInteger} level - copy depth\n* @returns {*} deep copy\n*/\nfunction deepCopy( val, copy, cache, refs, level ) {\n\tvar parent;\n\tvar keys;\n\tvar name;\n\tvar desc;\n\tvar ctor;\n\tvar key;\n\tvar ref;\n\tvar x;\n\tvar i;\n\tvar j;\n\n\tlevel -= 1;\n\n\t// Primitives and functions...\n\tif (\n\t\ttypeof val !== 'object' ||\n\t\tval === null\n\t) {\n\t\treturn val;\n\t}\n\tif ( isBuffer( val ) ) {\n\t\treturn copyBuffer( val );\n\t}\n\tif ( isError( val ) ) {\n\t\treturn copyError( val );\n\t}\n\t// Objects...\n\tname = typeOf( val );\n\n\tif ( name === 'date' ) {\n\t\treturn new Date( +val );\n\t}\n\tif ( name === 'regexp' ) {\n\t\treturn regexp( val.toString() );\n\t}\n\tif ( name === 'set' ) {\n\t\treturn new Set( val );\n\t}\n\tif ( name === 'map' ) {\n\t\treturn new Map( val );\n\t}\n\tif (\n\t\tname === 'string' ||\n\t\tname === 'boolean' ||\n\t\tname === 'number'\n\t) {\n\t\t// If provided an `Object`, return an equivalent primitive!\n\t\treturn val.valueOf();\n\t}\n\tctor = typedArrays[ name ];\n\tif ( ctor ) {\n\t\treturn ctor( val );\n\t}\n\t// Class instances...\n\tif (\n\t\tname !== 'array' &&\n\t\tname !== 'object'\n\t) {\n\t\t// Cloning requires ES5 or higher...\n\t\tif ( typeof Object.freeze === 'function' ) {\n\t\t\treturn cloneInstance( val );\n\t\t}\n\t\treturn {};\n\t}\n\t// Arrays and plain objects...\n\tkeys = objectKeys( val );\n\tif ( level > 0 ) {\n\t\tparent = name;\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tx = val[ key ];\n\n\t\t\t// Primitive, Buffer, special class instance...\n\t\t\tname = typeOf( x );\n\t\t\tif (\n\t\t\t\ttypeof x !== 'object' ||\n\t\t\t\tx === null ||\n\t\t\t\t(\n\t\t\t\t\tname !== 'array' &&\n\t\t\t\t\tname !== 'object'\n\t\t\t\t) ||\n\t\t\t\tisBuffer( x )\n\t\t\t) {\n\t\t\t\tif ( parent === 'object' ) {\n\t\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\t\tdesc.value = deepCopy( x );\n\t\t\t\t\t}\n\t\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t\t} else {\n\t\t\t\t\tcopy[ key ] = deepCopy( x );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Circular reference...\n\t\t\ti = indexOf( cache, x );\n\t\t\tif ( i !== -1 ) {\n\t\t\t\tcopy[ key ] = refs[ i ];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Plain array or object...\n\t\t\tref = ( isArray( x ) ) ? new Array( x.length ) : {};\n\t\t\tcache.push( x );\n\t\t\trefs.push( ref );\n\t\t\tif ( parent === 'array' ) {\n\t\t\t\tcopy[ key ] = deepCopy( x, ref, cache, refs, level );\n\t\t\t} else {\n\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\tdesc.value = deepCopy( x, ref, cache, refs, level );\n\t\t\t\t}\n\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t}\n\t\t}\n\t} else if ( name === 'array' ) {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tcopy[ key ] = val[ key ];\n\t\t}\n\t} else {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\tdefineProperty( copy, key, desc );\n\t\t}\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( copy );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( copy );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( copy );\n\t}\n\treturn copy;\n}\n\n\n// EXPORTS //\n\nexport default deepCopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport reRegExp from '@stdlib/regexp/regexp';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Parses a regular expression string and returns a new regular expression.\n*\n* @param {string} str - regular expression string\n* @throws {TypeError} must provide a regular expression string\n* @returns {(RegExp|null)} regular expression or null\n*\n* @example\n* var re = reFromString( '/beep/' );\n* // returns /beep/\n*/\nfunction reFromString( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a regular expression string. Value: `%s`.', str ) );\n\t}\n\t// Capture the regular expression pattern and any flags:\n\tstr = reRegExp().exec( str );\n\n\t// Create a new regular expression:\n\treturn ( str ) ? new RegExp( str[1], str[2] ) : null;\n}\n\n\n// EXPORTS //\n\nexport default reFromString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert/is-array';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\nimport PINF from '@stdlib/constants/float64/pinf';\nimport deepCopy from './deep_copy.js';\n\n\n// MAIN //\n\n/**\n* Copies or deep clones a value to an arbitrary depth.\n*\n* @param {*} value - value to copy\n* @param {NonNegativeInteger} [level=+infinity] - copy depth\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {*} value copy\n*\n* @example\n* var out = copy( 'beep' );\n* // returns 'beep'\n*\n* @example\n* var value = [\n* {\n* 'a': 1,\n* 'b': true,\n* 'c': [ 1, 2, 3 ]\n* }\n* ];\n* var out = copy( value );\n* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n*\n* var bool = ( value[0].c === out[0].c );\n* // returns false\n*/\nfunction copy( value, level ) {\n\tvar out;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isNonNegativeInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', level ) );\n\t\t}\n\t\tif ( level === 0 ) {\n\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tlevel = PINF;\n\t}\n\tout = ( isArray( value ) ) ? new Array( value.length ) : {};\n\treturn deepCopy( value, out, [value], [out], level );\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Tests that a value is a valid constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var ctor = function ctor() {};\n*\n* var err = validate( ctor );\n* // returns null\n*\n* err = validate( null );\n* // returns \n*/\nfunction validate( value ) {\n\tvar type = typeof value;\n\tif (\n\t\tvalue === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\treturn new TypeError( format( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.', value ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Object.create;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar createObject;\nif ( typeof builtin === 'function' ) {\n\tcreateObject = builtin;\n} else {\n\tcreateObject = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default createObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Ctor() {\n\t// Empty...\n}\n\n\n// MAIN //\n\n/**\n* An `Object.create` shim for older JavaScript engines.\n*\n* @private\n* @param {Object} proto - prototype\n* @returns {Object} created object\n*\n* @example\n* var obj = createObject( Object.prototype );\n* // returns {}\n*/\nfunction createObject( proto ) {\n\tCtor.prototype = proto;\n\treturn new Ctor();\n}\n\n\n// EXPORTS //\n\nexport default createObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './../../define-property';\nimport format from '@stdlib/string/format';\nimport validate from './validate.js';\nimport createObject from './detect.js';\n\n\n// MAIN //\n\n/**\n* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.\n*\n* ## Notes\n*\n* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.\n* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).\n*\n* @param {(Object|Function)} ctor - constructor which will inherit\n* @param {(Object|Function)} superCtor - super (parent) constructor\n* @throws {TypeError} first argument must be either an object or a function which can inherit\n* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit\n* @throws {TypeError} second argument must have an inheritable prototype\n* @returns {(Object|Function)} child constructor\n*\n* @example\n* function Foo() {\n* return this;\n* }\n* Foo.prototype.beep = function beep() {\n* return 'boop';\n* };\n*\n* function Bar() {\n* Foo.call( this );\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n* var v = bar.beep();\n* // returns 'boop'\n*/\nfunction inherit( ctor, superCtor ) {\n\tvar err = validate( ctor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\terr = validate( superCtor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( typeof superCtor.prototype === 'undefined' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.', superCtor.prototype ) );\n\t}\n\t// Create a prototype which inherits from the parent prototype:\n\tctor.prototype = createObject( superCtor.prototype );\n\n\t// Set the constructor to refer to the child constructor:\n\tdefineProperty( ctor.prototype, 'constructor', {\n\t\t'configurable': true,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': ctor\n\t});\n\n\treturn ctor;\n}\n\n\n// EXPORTS //\n\nexport default inherit;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants/float64/pinf';\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'level': PINF,\n\t\t'override': true,\n\t\t'extend': true,\n\t\t'copy': true\n\t};\n}\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from './../../keys';\nimport isObject from '@stdlib/assert/is-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport isFunction from '@stdlib/assert/is-function';\nimport typeOf from './../../type-of';\nimport deepCopy from './../../copy';\n\n\n// MAIN //\n\n/**\n* Merges a source object into a target object.\n*\n* @private\n* @param {Object} target - target object\n* @param {Object} source - source object\n* @param {number} level - merge level\n* @param {boolean} copy - indicates whether to perform a deep copy of merged values\n* @param {(boolean|Function)} override - defines the merge strategy\n* @param {boolean} extend - indicates whether new properties can be added to the target object\n*/\nfunction deepMerge( target, source, level, copy, override, extend ) {\n\tvar hasProp;\n\tvar isFunc;\n\tvar name;\n\tvar keys;\n\tvar curr;\n\tvar key;\n\tvar val;\n\tvar tmp;\n\tvar i;\n\n\t// Determine if we were provided a custom override strategy:\n\tisFunc = isFunction( override );\n\n\t// Decrement the level:\n\tlevel -= 1;\n\n\t// Loop through the source keys and implement the merge strategy...\n\tkeys = objectKeys( source );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\thasProp = hasOwnProp( target, key );\n\n\t\t// Can we add new properties to the target?\n\t\tif ( !hasProp && !extend ) {\n\t\t\tcontinue;\n\t\t}\n\t\tval = source[ key ];\n\n\t\tif ( hasProp ) {\n\t\t\tcurr = target[ key ];\n\t\t\tname = typeOf( curr );\n\n\t\t\t// Should we recurse to perform a deep(er) merge? (only if both the current value and the proposed value are objects and the level is > 0)\n\t\t\tif (\n\t\t\t\t!isBuffer( curr ) &&\n\t\t\t\tname === 'object' &&\n\t\t\t\tisObject( val ) &&\n\t\t\t\tlevel\n\t\t\t) {\n\t\t\t\tdeepMerge( curr, val, level, copy, override, extend );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Should we apply a custom merge (override) strategy?\n\t\t\tif ( isFunc ) {\n\t\t\t\ttmp = override( curr, val, key );\n\n\t\t\t\t// WARNING: the following check does NOT prevent shared (leaky) nested references. We only check for top-level reference equality. We will assume that the user knows best, given their having provided a custom override strategy.\n\t\t\t\tif ( copy && tmp !== curr && tmp === val ) {\n\t\t\t\t\ttmp = deepCopy( tmp );\n\t\t\t\t}\n\t\t\t\ttarget[ key ] = tmp;\n\t\t\t}\n\t\t\t// Are we allowed to override an existing target value?\n\t\t\telse if ( override ) {\n\t\t\t\tif ( copy ) {\n\t\t\t\t\ttarget[ key ] = deepCopy( val );\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// New property to be added to target object. Should we deep copy the source value?\n\t\telse if ( copy ) {\n\t\t\ttarget[ key ] = deepCopy( val );\n\t\t}\n\t\t// Perform a simple assignment...\n\t\telse {\n\t\t\ttarget[ key ] = val;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default deepMerge;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert/is-object';\nimport format from '@stdlib/string/format';\nimport deepMerge from './deepmerge.js';\n\n\n// MAIN //\n\n/**\n* Returns a merge function based on provided options.\n*\n* @private\n* @param {Options} opts - function options\n* @param {number} options.level - merge level\n* @param {boolean} options.copy - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} options.override - defines the merge strategy\n* @param {boolean} options.extend - boolean indicating whether new properties can be added to the target object\n* @returns {Function} merge function\n*\n* @example\n* var merge = mergefcn({\n* 'level': Number.POSITIVE_INFINITY,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* });\n* // returns \n*/\nfunction mergefcn( opts ) {\n\treturn merge;\n\n\t/**\n\t* Merges objects into a target object. Note that the target object is mutated.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n\t* @throws {Error} must provide a target object and one or more source objects\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} source arguments must be objects\n\t* @returns {Object} merged (target) object\n\t*\n\t* @example\n\t* var target = {\n\t* 'a': 'beep'\n\t* };\n\t* var source = {\n\t* 'a': 'boop',\n\t* 'b': 'bap'\n\t* };\n\t*\n\t* var out = merge( target, source );\n\t* // returns {'a':'boop', 'b':'bap'}\n\t*/\n\tfunction merge( target ) {\n\t\tvar nargs;\n\t\tvar arg;\n\t\tvar src;\n\t\tvar i;\n\n\t\tnargs = arguments.length - 1;\n\t\tif ( nargs < 1 ) {\n\t\t\tthrow new Error( 'insufficient arguments. Must provide both a target object and one or more source objects.' );\n\t\t}\n\t\tif ( !isObject( target ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', target ) );\n\t\t}\n\t\tsrc = new Array( nargs );\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targ = arguments[ i+1 ];\n\n\t\t\t// WARNING: this is a porous check. Buffers, Numbers, Booleans, Strings, Dates, RegExp, custom class instances,... will all pass.\n\t\t\tif ( !isObject( arg ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be objects. Index: `%u`. Value: `%s`.', i, arg ) );\n\t\t\t}\n\t\t\tsrc[ i ] = arg;\n\t\t}\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tdeepMerge( target, src[ i ], opts.level, opts.copy, opts.override, opts.extend ); // eslint-disable-line max-len\n\t\t}\n\t\treturn target;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default mergefcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defaults from './defaults.js';\nimport mergefcn from './mergefcn.js';\n\n\n// MAIN //\n\n/**\n* Merges objects into a target object. Note that the target object is mutated.\n*\n* @name merge\n* @type {Function}\n* @param {Object} target - target object\n* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n* @throws {Error} must provide a target object and one or more source objects\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} source arguments must be objects\n* @returns {Object} merged (target) object\n*\n* @example\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*/\nvar merge = mergefcn( defaults() );\n\n\n// EXPORTS //\n\nexport default merge;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from './../../is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from './../../is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a positive integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive integer\n*\n* @example\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( null );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport validate from './validate.js';\nimport defaults from './defaults.js';\nimport mergefcn from './mergefcn.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for merging and extending objects.\n*\n* @param {Options} options - merge options\n* @param {number} [options.level=Infinity] - merge level\n* @param {boolean} [options.copy=true] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override=true] - defines the merge strategy\n* @param {boolean} [options.extend=true] - boolean indicating whether new properties can be added to the target object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function which can be used to merge objects\n*\n* @example\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar err;\n\topts = defaults();\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\treturn mergefcn( opts );\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport isFunction from '@stdlib/assert/is-function';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert/is-positive-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {number} [options.level] - merge level\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override] - defines the merge strategy\n* @param {boolean} [options.extend] - boolean indicating whether new properties can be added to the target object\n* @returns {(Error|null)} error object or null\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'level' ) ) {\n\t\topts.level = options.level;\n\t\tif ( !isPositiveInteger( opts.level ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'level', opts.level ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'override' ) ) {\n\t\topts.override = options.override;\n\t\tif (\n\t\t\t!isBoolean( opts.override ) &&\n\t\t\t!isFunction( opts.override )\n\t\t) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be either a boolean or a function. Option: `%s`.', 'override', opts.override ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'extend' ) ) {\n\t\topts.extend = options.extend;\n\t\tif ( !isBoolean( opts.extend ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'extend', opts.extend ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './../../define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './../../define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadWriteAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive integer.\n*\n* @module @stdlib/assert/is-positive-integer\n*\n* @example\n* import isPositiveInteger from '@stdlib/assert/is-positive-integer';\n*\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* bool = isPositiveInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveInteger } from '@stdlib/assert/is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveInteger } from '@stdlib/assert/is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Merge and extend objects.\n*\n* @module @stdlib/utils/merge\n*\n* @example\n* import merge from '@stdlib/utils/merge';\n*\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*\n* @example\n* import { factory as factory } from '@stdlib/utils/merge';\n*\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\n\n// MODULES //\n\nimport setReadOnly from './../../define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport factory from './factory.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array/int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array/int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array/int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array/uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array/uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array/uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array/uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array/dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array/int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array/int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array/int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array/uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array/uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array/uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array/uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array/dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 3.0\n*\n* var im = imag( v );\n* // returns 4.0\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import dtype from '@stdlib/array/dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 10.0\n*\n* var im = imag( v );\n* // returns 11.0\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import dtype from '@stdlib/array/dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a generic array.\n*\n* @module @stdlib/constants/array/max-array-length\n*\n* @example\n* import MAX_ARRAY_LENGTH from '@stdlib/constants/array/max-array-length';\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default MAX_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport MAX_LENGTH from '@stdlib/constants/array/max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLikeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils/native-class';\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array of strings.\n*\n* @module @stdlib/assert/is-string-array\n*\n* @example\n* import isStringArray from '@stdlib/assert/is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* import { primitives as isStringArray } from '@stdlib/assert/is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* import { objects as isStringArray } from '@stdlib/assert/is-string-array';\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport arrayfun from './../../tools/array-function';\nimport isString from './../../is-string';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isStringArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport format from '@stdlib/string/format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tdefineProperty( this, 're', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': real\n\t});\n\tdefineProperty( this, 'im', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': imag\n\t});\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar fround = ( typeof Math.fround === 'function' ) ? Math.fround : null; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default fround;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/to-float32\n*\n* @example\n* import float64ToFloat32 from '@stdlib/number/float64/base/to-float32';\n*\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\n\n// MODULES //\n\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar float64ToFloat32;\nif ( typeof builtin === 'function' ) {\n\tfloat64ToFloat32 = builtin;\n} else {\n\tfloat64ToFloat32 = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array/float32';\n\n\n// VARIABLES //\n\nvar FLOAT32_VIEW = new Float32Array( 1 );\n\n\n// MAIN //\n\n/**\n* Converts a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @param {number} x - double-precision floating-point number\n* @returns {number} nearest single-precision floating-point number\n*\n* @example\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\nfunction float64ToFloat32( x ) {\n\tFLOAT32_VIEW[ 0 ] = x;\n\treturn FLOAT32_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport float64ToFloat32 from '@stdlib/number/float64/base/to-float32';\nimport format from '@stdlib/string/format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tdefineProperty( this, 're', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': float64ToFloat32( real )\n\t});\n\tdefineProperty( this, 'im', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': float64ToFloat32( imag )\n\t});\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from '@stdlib/complex/float64/ctor';\nimport Complex64 from '@stdlib/complex/float32/ctor';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from './../../../../base/assert/is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex64';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from './../../has-own-property';\nimport Symbol from '@stdlib/symbol/ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns \n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasIteratorSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasIteratorSymbolSupport from '@stdlib/assert/has-iterator-symbol-support';\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nexport default IteratorSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array/float32';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array/float64';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport realf from '@stdlib/complex/float32/real';\nimport imagf from '@stdlib/complex/float32/imag';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isCollection from '@stdlib/assert/is-collection';\nimport isArrayBuffer from '@stdlib/assert/is-arraybuffer';\nimport isObject from '@stdlib/assert/is-object';\nimport isArray from '@stdlib/assert/is-array';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport isEven from '@stdlib/math/base/assert/is-even';\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport isComplex64Array from './../../base/assert/is-complex64array';\nimport isComplex128Array from './../../base/assert/is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert/has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol/iterator';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils/define-nonenumerable-read-only-accessor';\nimport Float32Array from './../../float32';\nimport Complex64 from '@stdlib/complex/float32/ctor';\nimport format from '@stdlib/string/format';\nimport realf from '@stdlib/complex/float32/real';\nimport imagf from '@stdlib/complex/float32/imag';\nimport floor from '@stdlib/math/base/special/floor';\nimport reinterpret64 from '@stdlib/strided/base/reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided/base/reinterpret-complex128';\nimport getter from './../../base/getter';\nimport accessorGetter from './../../base/accessor-getter';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import caddf from '@stdlib/complex/float32/base/add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import caddf from '@stdlib/complex/float32/base/add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = realf( v );\n* // returns 1.0\n*\n* var im = imagf( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = realf( v );\n* // returns 2.0\n*\n* im = imagf( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* import realf from '@stdlib/complex/float32/real';\n* import imagf from '@stdlib/complex/float32/imag';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport realf from '@stdlib/complex/float32/real';\nimport imagf from '@stdlib/complex/float32/imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport format from '@stdlib/string/format';\nimport real from '@stdlib/complex/float64/real';\nimport imag from '@stdlib/complex/float64/imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport realf from '@stdlib/complex/float32/real';\nimport imagf from '@stdlib/complex/float32/imag';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isCollection from '@stdlib/assert/is-collection';\nimport isArrayBuffer from '@stdlib/assert/is-arraybuffer';\nimport isObject from '@stdlib/assert/is-object';\nimport isArray from '@stdlib/assert/is-array';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport isString from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport isEven from '@stdlib/math/base/assert/is-even';\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport isComplex64Array from './../../base/assert/is-complex64array';\nimport isComplex128Array from './../../base/assert/is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert/has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol/iterator';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils/define-nonenumerable-read-only-accessor';\nimport Float64Array from './../../float64';\nimport Complex128 from '@stdlib/complex/float64/ctor';\nimport real from '@stdlib/complex/float64/real';\nimport imag from '@stdlib/complex/float64/imag';\nimport floor from '@stdlib/math/base/special/floor';\nimport reinterpret64 from '@stdlib/strided/base/reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided/base/reinterpret-complex128';\nimport getter from './../../base/getter';\nimport accessorGetter from './../../base/accessor-getter';\nimport format from '@stdlib/string/format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n* import cadd from '@stdlib/complex/float64/base/add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n* import cadd from '@stdlib/complex/float64/base/add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = real( v );\n* // returns 1.0\n*\n* var im = imag( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = real( v );\n* // returns 2.0\n*\n* im = imag( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* import real from '@stdlib/complex/float64/real';\n* import imag from '@stdlib/complex/float64/imag';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 4.0\n*\n* var im = imag( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport real from '@stdlib/complex/float64/real';\nimport imag from '@stdlib/complex/float64/imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean/ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert/is-array-like-object';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport format from '@stdlib/string/format';\nimport real from '@stdlib/complex/float64/real';\nimport imag from '@stdlib/complex/float64/imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport isCollection from '@stdlib/assert/is-collection';\nimport isArrayBuffer from '@stdlib/assert/is-arraybuffer';\nimport isObject from '@stdlib/assert/is-object';\nimport isFunction from '@stdlib/assert/is-function';\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert/is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport hasIteratorSymbolSupport from '@stdlib/assert/has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol/iterator';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils/define-nonenumerable-read-only-accessor';\nimport Uint8Array from './../../uint8';\nimport Boolean from '@stdlib/boolean/ctor';\nimport getter from './../../base/getter';\nimport floor from '@stdlib/math/base/special/floor';\nimport accessorGetter from './../../base/accessor-getter';\nimport format from '@stdlib/string/format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* import ArrayBuffer from '@stdlib/array/buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean/ctor';\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean/ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from './../../float64';\nimport Float32Array from './../../float32';\nimport Uint32Array from './../../uint32';\nimport Int32Array from './../../int32';\nimport Uint16Array from './../../uint16';\nimport Int16Array from './../../int16';\nimport Uint8Array from './../../uint8';\nimport Uint8ClampedArray from './../../uint8c';\nimport Int8Array from './../../int8';\nimport Complex64Array from './../../complex64';\nimport Complex128Array from './../../complex128';\nimport BooleanArray from './../../bool';\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport isArray from '@stdlib/assert/is-array';\nimport constructorName from '@stdlib/utils/constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from './../../../base/assert/is-accessor-array';\nimport getter from './../../../base/getter';\nimport setter from './../../../base/setter';\nimport accessorGetter from './../../../base/accessor-getter';\nimport accessorSetter from './../../../base/accessor-setter';\nimport dtype from './../../../dtype';\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} output array object\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import reinterpret64 from '@stdlib/strided/base/reinterpret-complex64';\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gcopy( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var view = reinterpret64( y.data, 0 );\n* // view => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( ybuf, iy, get( xbuf, ix ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array/base/arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Dummy function.\n*\n* @private\n*/\nfunction foo() {\n\t// No-op...\n}\n\n\n// EXPORTS //\n\nexport default foo;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/gcopy\n*\n* @example\n* import gcopy from '@stdlib/blas/base/gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* import gcopy from '@stdlib/blas/base/gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array/base/arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport hasFunctionNameSupport from '@stdlib/assert/has-function-name-support';\nimport format from '@stdlib/string/format';\nimport { REGEXP as RE } from '@stdlib/regexp/function-name';\n\n\n// VARIABLES //\n\nvar isFunctionNameSupported = hasFunctionNameSupport();\n\n\n// MAIN //\n\n/**\n* Returns the name of a function.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} function name\n*\n* @example\n* var v = functionName( Math.sqrt );\n* // returns 'sqrt'\n*\n* @example\n* var v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* @example\n* var v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*\n* @example\n* var v = functionName( String );\n* // returns 'String'\n*/\nfunction functionName( fcn ) {\n\t// TODO: add support for generator functions?\n\tif ( isFunction( fcn ) === false ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isFunctionNameSupported ) {\n\t\treturn fcn.name;\n\t}\n\treturn RE.exec( fcn.toString() )[ 1 ];\n}\n\n\n// EXPORTS //\n\nexport default functionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport foo from './foo.js';\n\n\n// MAIN //\n\n/**\n* Tests for native function `name` support.\n*\n* @returns {boolean} boolean indicating if an environment has function `name` support\n*\n* @example\n* var bool = hasFunctionNameSupport();\n* // returns \n*/\nfunction hasFunctionNameSupport() {\n\treturn ( foo.name === 'foo' );\n}\n\n\n// EXPORTS //\n\nexport default hasFunctionNameSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array/int8';\nimport Uint8Array from '@stdlib/array/uint8';\nimport Uint8ClampedArray from '@stdlib/array/uint8c';\nimport Int16Array from '@stdlib/array/int16';\nimport Uint16Array from '@stdlib/array/uint16';\nimport Int32Array from '@stdlib/array/int32';\nimport Uint32Array from '@stdlib/array/uint32';\nimport Float32Array from '@stdlib/array/float32';\nimport Float64Array from '@stdlib/array/float64';\n\n\n// MAIN //\n\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils/constructor-name';\nimport fcnName from '@stdlib/utils/function-name';\nimport getPrototypeOf from '@stdlib/utils/get-prototype-of';\nimport hasFloat64ArraySupport from './../../has-float64array-support';\nimport Float64Array from '@stdlib/array/float64';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// VARIABLES //\n\n// Abstract `TypedArray` class:\nvar TypedArray = ( hasFloat64ArraySupport() ) ? getPrototypeOf( Float64Array ) : Dummy; // eslint-disable-line max-len\n\n// Ensure abstract typed array class has expected name:\nTypedArray = ( fcnName( TypedArray ) === 'TypedArray' ) ? TypedArray : Dummy;\n\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Dummy() {} // eslint-disable-line no-empty-function\n\n\n// MAIN //\n\n/**\n* Tests if a value is a typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a typed array\n*\n* @example\n* import Int8Array from '@stdlib/array/int8';\n*\n* var bool = isTypedArray( new Int8Array( 10 ) );\n* // returns true\n*/\nfunction isTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for the abstract class...\n\tif ( value instanceof TypedArray ) {\n\t\treturn true;\n\t}\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64Array from '@stdlib/array/complex64';\nimport Complex128Array from '@stdlib/array/complex128';\n\n\n// MAIN //\n\nvar CTORS = [\n\tComplex128Array,\n\tComplex64Array\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array/uint8';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* import BooleanArray from '@stdlib/array/bool';\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Tests whether a value has in its prototype chain a specified constructor as a prototype property.\n*\n* @param {*} value - value to test\n* @param {Function} constructor - constructor to test against\n* @throws {TypeError} constructor must be callable\n* @returns {boolean} boolean indicating whether a value is an instance of a provided constructor\n*\n* @example\n* var bool = instanceOf( [], Array );\n* // returns true\n*\n* @example\n* var bool = instanceOf( {}, Object ); // exception\n* // returns true\n*\n* @example\n* var bool = instanceOf( 'beep', String );\n* // returns false\n*\n* @example\n* var bool = instanceOf( null, Object );\n* // returns false\n*\n* @example\n* var bool = instanceOf( 5, Object );\n* // returns false\n*/\nfunction instanceOf( value, constructor ) {\n\t// TODO: replace with `isCallable` check\n\tif ( typeof constructor !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be callable. Value: `%s`.', constructor ) );\n\t}\n\treturn ( value instanceof constructor );\n}\n\n\n// EXPORTS //\n\nexport default instanceOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from './../../int8';\nimport Uint8Array from './../../uint8';\nimport Uint8ClampedArray from './../../uint8c';\nimport Int16Array from './../../int16';\nimport Uint16Array from './../../uint16';\nimport Int32Array from './../../int32';\nimport Uint32Array from './../../uint32';\nimport Float32Array from './../../float32';\nimport Float64Array from './../../float64';\nimport Complex64Array from './../../complex64';\nimport Complex128Array from './../../complex128';\nimport BooleanArray from './../../bool';\n\n\n// MAIN //\n\nvar CTORS = [\n\t[ Float64Array, 'Float64Array' ],\n\t[ Float32Array, 'Float32Array' ],\n\t[ Int32Array, 'Int32Array' ],\n\t[ Uint32Array, 'Uint32Array' ],\n\t[ Int16Array, 'Int16Array' ],\n\t[ Uint16Array, 'Uint16Array' ],\n\t[ Int8Array, 'Int8Array' ],\n\t[ Uint8Array, 'Uint8Array' ],\n\t[ Uint8ClampedArray, 'Uint8ClampedArray' ],\n\t[ Complex64Array, 'Complex64Array' ],\n\t[ Complex128Array, 'Complex128Array' ],\n\t[ BooleanArray, 'BooleanArray' ]\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport instanceOf from '@stdlib/assert/instance-of';\nimport ctorName from '@stdlib/utils/constructor-name';\nimport getPrototypeOf from '@stdlib/utils/get-prototype-of';\nimport CTORS from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns the typed array type.\n*\n* @private\n* @param {TypedArray} arr - typed array\n* @returns {(string|void)} typed array type\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var arr = new Float64Array( 5 );\n* var str = typeName( arr );\n* // returns 'Float64Array'\n*/\nfunction typeName( arr ) {\n\tvar v;\n\tvar i;\n\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( instanceOf( arr, CTORS[ i ][ 0 ] ) ) {\n\t\t\treturn CTORS[ i ][ 1 ];\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired native class...\n\twhile ( arr ) {\n\t\tv = ctorName( arr );\n\t\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\t\tif ( v === CTORS[ i ][ 1 ] ) {\n\t\t\t\treturn CTORS[ i ][ 1 ];\n\t\t\t}\n\t\t}\n\t\tarr = getPrototypeOf( arr );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default typeName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isTypedArray from '@stdlib/assert/is-typed-array';\nimport isComplexTypedArray from '@stdlib/assert/is-complex-typed-array';\nimport isBooleanArray from '@stdlib/assert/is-booleanarray';\nimport reinterpret64 from '@stdlib/strided/base/reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided/base/reinterpret-complex128';\nimport reinterpretBoolean from '@stdlib/strided/base/reinterpret-boolean';\nimport format from '@stdlib/string/format';\nimport typeName from './type.js';\n\n\n// MAIN //\n\n/**\n* Returns a JSON representation of a typed array.\n*\n* ## Notes\n*\n* - We build a JSON object representing a typed array similar to how Node.js `Buffer` objects are represented. See [Buffer][1].\n*\n* [1]: https://nodejs.org/api/buffer.html#buffer_buf_tojson\n*\n* @param {TypedArray} arr - typed array to serialize\n* @throws {TypeError} first argument must be a typed array\n* @returns {Object} JSON representation\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var arr = new Float64Array( [ 5.0, 3.0 ] );\n* var json = typedarray2json( arr );\n* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n*/\nfunction typedarray2json( arr ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tif ( isTypedArray( arr ) ) {\n\t\tdata = arr;\n\t} else if ( isComplexTypedArray( arr ) ) {\n\t\tif ( arr.BYTES_PER_ELEMENT === 8 ) {\n\t\t\tdata = reinterpret64( arr, 0 );\n\t\t} else { // arr.BYTES_PER_ELEMENT === 16\n\t\t\tdata = reinterpret128( arr, 0 );\n\t\t}\n\t} else if ( isBooleanArray( arr ) ) {\n\t\tdata = reinterpretBoolean( arr, 0 );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a typed array. Value: `%s`.', arr ) );\n\t}\n\tout = {\n\t\t'type': typeName( arr ),\n\t\t'data': []\n\t};\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.data.push( data[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default typedarray2json;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport BooleanArray from '@stdlib/array/bool';\nimport constructorName from '@stdlib/utils/constructor-name';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BooleanArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a BooleanArray\n*\n* @example\n* import BooleanArray from '@stdlib/array/bool';\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isBooleanArray( [] );\n* // returns false\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\tvalue instanceof BooleanArray ||\n\t\tconstructorName( value ) === 'BooleanArray'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils/constructor-name';\nimport getPrototypeOf from '@stdlib/utils/get-prototype-of';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*/\nfunction isComplexTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for complex typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isComplexTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport INT32_MAX from '@stdlib/constants/int32/max';\nimport floor from '@stdlib/math/base/special/floor';\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nexport default randint32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils/define-nonenumerable-read-only-accessor';\nimport setReadWriteAccessor from '@stdlib/utils/define-nonenumerable-read-write-accessor';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport isCollection from '@stdlib/assert/is-collection';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert/is-positive-integer';\nimport isInt32Array from '@stdlib/assert/is-int32array';\nimport format from '@stdlib/string/format';\nimport INT32_MAX from '@stdlib/constants/int32/max';\nimport Int32Array from '@stdlib/array/int32';\nimport gcopy from '@stdlib/blas/base/gcopy';\nimport typedarray2json from '@stdlib/array/to-json';\nimport randint32 from './rand_int32.js';\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 2; // state, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstd.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from './factory.js';\nimport randint32 from './rand_int32.js';\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192–1201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nexport default minstd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* import minstd from '@stdlib/random/base/minstd';\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* import { factory as factory } from '@stdlib/random/base/minstd';\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport factory from './factory.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nexport default main;\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","module.exports = \"2\"\n","var version = require(\"./version\")\n\nmodule.exports = isVirtualNode\n\nfunction isVirtualNode(x) {\n return x && x.type === \"VirtualNode\" && x.version === version\n}\n","var version = require(\"./version\")\n\nmodule.exports = isVirtualText\n\nfunction isVirtualText(x) {\n return x && x.type === \"VirtualText\" && x.version === version\n}\n","module.exports = isThunk\r\n\r\nfunction isThunk(t) {\r\n return t && t.type === \"Thunk\"\r\n}\r\n","module.exports = isWidget\n\nfunction isWidget(w) {\n return w && w.type === \"Widget\"\n}\n","'use strict';\n\nmodule.exports = SoftSetHook;\n\nfunction SoftSetHook(value) {\n if (!(this instanceof SoftSetHook)) {\n return new SoftSetHook(value);\n }\n\n this.value = value;\n}\n\nSoftSetHook.prototype.hook = function (node, propertyName) {\n if (node[propertyName] !== this.value) {\n node[propertyName] = this.value;\n }\n};\n","'use strict';\n\nmodule.exports = AttributeHook;\n\nfunction AttributeHook(namespace, value) {\n if (!(this instanceof AttributeHook)) {\n return new AttributeHook(namespace, value);\n }\n\n this.namespace = namespace;\n this.value = value;\n}\n\nAttributeHook.prototype.hook = function (node, prop, prev) {\n if (prev && prev.type === 'AttributeHook' &&\n prev.value === this.value &&\n prev.namespace === this.namespace) {\n return;\n }\n\n node.setAttributeNS(this.namespace, prop, this.value);\n};\n\nAttributeHook.prototype.unhook = function (node, prop, next) {\n if (next && next.type === 'AttributeHook' &&\n next.namespace === this.namespace) {\n return;\n }\n\n var colonPosition = prop.indexOf(':');\n var localName = colonPosition > -1 ? prop.substr(colonPosition + 1) : prop;\n node.removeAttributeNS(this.namespace, localName);\n};\n\nAttributeHook.prototype.type = 'AttributeHook';\n","/**\n * Special language-specific overrides.\n *\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n *\n * @type {Object}\n */\nvar LANGUAGES = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n '\\u0130': '\\u0069',\n '\\u0049': '\\u0131',\n '\\u0049\\u0307': '\\u0069'\n }\n },\n az: {\n regexp: /[\\u0130]/g,\n map: {\n '\\u0130': '\\u0069',\n '\\u0049': '\\u0131',\n '\\u0049\\u0307': '\\u0069'\n }\n },\n lt: {\n regexp: /[\\u0049\\u004A\\u012E\\u00CC\\u00CD\\u0128]/g,\n map: {\n '\\u0049': '\\u0069\\u0307',\n '\\u004A': '\\u006A\\u0307',\n '\\u012E': '\\u012F\\u0307',\n '\\u00CC': '\\u0069\\u0307\\u0300',\n '\\u00CD': '\\u0069\\u0307\\u0301',\n '\\u0128': '\\u0069\\u0307\\u0303'\n }\n }\n}\n\n/**\n * Lowercase a string.\n *\n * @param {String} str\n * @return {String}\n */\nmodule.exports = function (str, locale) {\n var lang = LANGUAGES[locale]\n\n str = str == null ? '' : String(str)\n\n if (lang) {\n str = str.replace(lang.regexp, function (m) { return lang.map[m] })\n }\n\n return str.toLowerCase()\n}\n","var escape = require('escape-html');\nvar propConfig = require('./property-config');\nvar types = propConfig.attributeTypes;\nvar properties = propConfig.properties;\nvar attributeNames = propConfig.attributeNames;\n\nvar prefixAttribute = memoizeString(function (name) {\n return escape(name) + '=\"';\n});\n\nmodule.exports = createAttribute;\n\n/**\n * Create attribute string.\n *\n * @param {String} name The name of the property or attribute\n * @param {*} value The value\n * @param {Boolean} [isAttribute] Denotes whether `name` is an attribute.\n * @return {?String} Attribute string || null if not a valid property or custom attribute.\n */\n\nfunction createAttribute(name, value, isAttribute) {\n if (properties.hasOwnProperty(name)) {\n if (shouldSkip(name, value)) return '';\n name = (attributeNames[name] || name).toLowerCase();\n var attrType = properties[name];\n // for BOOLEAN `value` only has to be truthy\n // for OVERLOADED_BOOLEAN `value` has to be === true\n if ((attrType === types.BOOLEAN) ||\n (attrType === types.OVERLOADED_BOOLEAN && value === true)) {\n return escape(name);\n }\n return prefixAttribute(name) + escape(value) + '\"';\n } else if (isAttribute) {\n if (value == null) return '';\n return prefixAttribute(name) + escape(value) + '\"';\n }\n // return null if `name` is neither a valid property nor an attribute\n return null;\n}\n\n/**\n * Should skip false boolean attributes.\n */\n\nfunction shouldSkip(name, value) {\n var attrType = properties[name];\n return value == null ||\n (attrType === types.BOOLEAN && !value) ||\n (attrType === types.OVERLOADED_BOOLEAN && value === false);\n}\n\n/**\n * Memoizes the return value of a function that accepts one string argument.\n *\n * @param {function} callback\n * @return {function}\n */\n\nfunction memoizeString(callback) {\n var cache = {};\n return function(string) {\n if (cache.hasOwnProperty(string)) {\n return cache[string];\n } else {\n return cache[string] = callback.call(this, string);\n }\n };\n}","var lowerCase = require('lower-case')\n\nvar NON_WORD_REGEXP = require('./vendor/non-word-regexp')\nvar CAMEL_CASE_REGEXP = require('./vendor/camel-case-regexp')\nvar TRAILING_DIGIT_REGEXP = require('./vendor/trailing-digit-regexp')\n\n/**\n * Sentence case a string.\n *\n * @param {String} str\n * @param {String} locale\n * @param {String} replacement\n * @return {String}\n */\nmodule.exports = function (str, locale, replacement) {\n if (str == null) {\n return ''\n }\n\n replacement = replacement || ' '\n\n function replace (match, index, string) {\n if (index === 0 || index === (string.length - match.length)) {\n return ''\n }\n\n return replacement\n }\n\n str = String(str)\n // Support camel case (\"camelCase\" -> \"camel Case\").\n .replace(CAMEL_CASE_REGEXP, '$1 $2')\n // Support digit groups (\"test2012\" -> \"test 2012\").\n .replace(TRAILING_DIGIT_REGEXP, '$1 $2')\n // Remove all non-word characters and replace with a single space.\n .replace(NON_WORD_REGEXP, replace)\n\n // Lower case the entire string.\n return lowerCase(str, locale)\n}\n","module.exports = /[^\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\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DC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u0030-\\u0039\\u00B2\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]+/g\n","module.exports = /([\\u0061-\\u007A\\u00B5\\u00DF-\\u00F6\\u00F8-\\u00FF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E-\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199-\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD-\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233-\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F-\\u0293\\u0295-\\u02AF\\u0371\\u0373\\u0377\\u037B-\\u037D\\u0390\\u03AC-\\u03CE\\u03D0\\u03D1\\u03D5-\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF-\\u03F3\\u03F5\\u03F8\\u03FB\\u03FC\\u0430-\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0525\\u0527\\u0561-\\u0587\\u1D00-\\u1D2B\\u1D6B-\\u1D77\\u1D79-\\u1D9A\\u1E01\\u1E03\\u1E05\\u1E07\\u1E09\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1E1F\\u1E21\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E2D\\u1E2F\\u1E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C5E\\u2C61\\u2C65\\u2C66\\u2C68\\u2C6A\\u2C6C\\u2C71\\u2C73\\u2C74\\u2C76-\\u2C7B\\u2C81\\u2C83\\u2C85\\u2C87\\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3\\u2CE4\\u2CEC\\u2CEE\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA661\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F-\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771-\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uA78E\\uA791\\uA793\\uA7A1\\uA7A3\\uA7A5\\uA7A7\\uA7A9\\uA7FA\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFF41-\\uFF5A])([\\u0041-\\u005A\\u00C0-\\u00D6\\u00D8-\\u00DE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017B\\u017D\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189-\\u018B\\u018E-\\u0191\\u0193\\u0194\\u0196-\\u0198\\u019C\\u019D\\u019F\\u01A0\\u01A2\\u01A4\\u01A6\\u01A7\\u01A9\\u01AC\\u01AE\\u01AF\\u01B1-\\u01B3\\u01B5\\u01B7\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6-\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A\\u023B\\u023D\\u023E\\u0241\\u0243-\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u0386\\u0388-\\u038A\\u038C\\u038E\\u038F\\u0391-\\u03A1\\u03A3-\\u03AB\\u03CF\\u03D2-\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9\\u03FA\\u03FD-\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0524\\u0526\\u0531-\\u0556\\u10A0-\\u10C5\\u10C7\\u10CD\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E\\u1E70\\u1E72\\u1E74\\u1E76\\u1E78\\u1E7A\\u1E7C\\u1E7E\\u1E80\\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\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\u2CEB\\u2CED\\u2CF2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA660\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uA78D\\uA790\\uA792\\uA7A0\\uA7A2\\uA7A4\\uA7A6\\uA7A8\\uA7AA\\uFF21-\\uFF3A\\u0030-\\u0039\\u00B2\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19])/g\n","module.exports = /([\\u0030-\\u0039\\u00B2\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19])([^\\u0030-\\u0039\\u00B2\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19])/g\n","var sentenceCase = require('sentence-case')\n\n/**\n * Param case a string.\n *\n * @param {String} string\n * @param {String} [locale]\n * @return {String}\n */\nmodule.exports = function (string, locale) {\n return sentenceCase(string, locale, '-')\n}\n","/**\n * Attribute types.\n */\n\nvar types = {\n BOOLEAN: 1,\n OVERLOADED_BOOLEAN: 2\n};\n\n/**\n * Properties.\n *\n * Taken from https://github.com/facebook/react/blob/847357e42e5267b04dd6e297219eaa125ab2f9f4/src/browser/ui/dom/HTMLDOMPropertyConfig.js\n *\n */\n\nvar properties = {\n /**\n * Standard Properties\n */\n accept: true,\n acceptCharset: true,\n accessKey: true,\n action: true,\n allowFullScreen: types.BOOLEAN,\n allowTransparency: true,\n alt: true,\n async: types.BOOLEAN,\n autocomplete: true,\n autofocus: types.BOOLEAN,\n autoplay: types.BOOLEAN,\n cellPadding: true,\n cellSpacing: true,\n charset: true,\n checked: types.BOOLEAN,\n classID: true,\n className: true,\n cols: true,\n colSpan: true,\n content: true,\n contentEditable: true,\n contextMenu: true,\n controls: types.BOOLEAN,\n coords: true,\n crossOrigin: true,\n data: true, // For `` acts as `src`.\n dateTime: true,\n defer: types.BOOLEAN,\n dir: true,\n disabled: types.BOOLEAN,\n download: types.OVERLOADED_BOOLEAN,\n draggable: true,\n enctype: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: types.BOOLEAN,\n formTarget: true,\n frameBorder: true,\n headers: true,\n height: true,\n hidden: types.BOOLEAN,\n href: true,\n hreflang: true,\n htmlFor: true,\n httpEquiv: true,\n icon: true,\n id: true,\n label: true,\n lang: true,\n list: true,\n loop: types.BOOLEAN,\n manifest: true,\n marginHeight: true,\n marginWidth: true,\n max: true,\n maxLength: true,\n media: true,\n mediaGroup: true,\n method: true,\n min: true,\n multiple: types.BOOLEAN,\n muted: types.BOOLEAN,\n name: true,\n noValidate: types.BOOLEAN,\n open: true,\n pattern: true,\n placeholder: true,\n poster: true,\n preload: true,\n radiogroup: true,\n readOnly: types.BOOLEAN,\n rel: true,\n required: types.BOOLEAN,\n role: true,\n rows: true,\n rowSpan: true,\n sandbox: true,\n scope: true,\n scrolling: true,\n seamless: types.BOOLEAN,\n selected: types.BOOLEAN,\n shape: true,\n size: true,\n sizes: true,\n span: true,\n spellcheck: true,\n src: true,\n srcdoc: true,\n srcset: true,\n start: true,\n step: true,\n style: true,\n tabIndex: true,\n target: true,\n title: true,\n type: true,\n useMap: true,\n value: true,\n width: true,\n wmode: true,\n\n /**\n * Non-standard Properties\n */\n // autoCapitalize and autoCorrect are supported in Mobile Safari for\n // keyboard hints.\n autocapitalize: true,\n autocorrect: true,\n // itemProp, itemScope, itemType are for Microdata support. See\n // http://schema.org/docs/gs.html\n itemProp: true,\n itemScope: types.BOOLEAN,\n itemType: true,\n // property is supported for OpenGraph in meta tags.\n property: true\n};\n\n/**\n * Properties to attributes mapping.\n *\n * The ones not here are simply converted to lower case.\n */\n\nvar attributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv'\n};\n\n/**\n * Exports.\n */\n\nmodule.exports = {\n attributeTypes: types,\n properties: properties,\n attributeNames: attributeNames\n};","\n/**\n * Void elements.\n *\n * https://github.com/facebook/react/blob/v0.12.0/src/browser/ui/ReactDOMComponent.js#L99\n */\n\nmodule.exports = {\n 'area': true,\n 'base': true,\n 'br': true,\n 'col': true,\n 'embed': true,\n 'hr': true,\n 'img': true,\n 'input': true,\n 'keygen': true,\n 'link': true,\n 'meta': true,\n 'param': true,\n 'source': true,\n 'track': true,\n 'wbr': true\n};","var escape = require('escape-html');\nvar extend = require('xtend');\nvar isVNode = require('virtual-dom/vnode/is-vnode');\nvar isVText = require('virtual-dom/vnode/is-vtext');\nvar isThunk = require('virtual-dom/vnode/is-thunk');\nvar isWidget = require('virtual-dom/vnode/is-widget');\nvar softHook = require('virtual-dom/virtual-hyperscript/hooks/soft-set-hook');\nvar attrHook = require('virtual-dom/virtual-hyperscript/hooks/attribute-hook');\nvar paramCase = require('param-case');\nvar createAttribute = require('./create-attribute');\nvar voidElements = require('./void-elements');\n\nmodule.exports = toHTML;\n\nfunction toHTML(node, parent) {\n if (!node) return '';\n\n if (isThunk(node)) {\n node = node.render();\n }\n\n if (isWidget(node) && node.render) {\n node = node.render();\n }\n\n if (isVNode(node)) {\n return openTag(node) + tagContent(node) + closeTag(node);\n } else if (isVText(node)) {\n if (parent && (parent.tagName.toLowerCase() === 'script'\n || parent.tagName.toLowerCase() === 'style'))\n return String(node.text);\n return escape(String(node.text));\n }\n\n return '';\n}\n\nfunction openTag(node) {\n var props = node.properties;\n var ret = '<' + node.tagName.toLowerCase();\n\n for (var name in props) {\n var value = props[name];\n if (value == null) continue;\n\n if (name == 'attributes') {\n value = extend({}, value);\n for (var attrProp in value) {\n ret += ' ' + createAttribute(attrProp, value[attrProp], true);\n }\n continue;\n }\n\n if (name == 'dataset') {\n value = extend({}, value);\n for (var dataProp in value) {\n ret += ' ' + createAttribute('data-' + paramCase(dataProp), value[dataProp], true);\n }\n continue;\n }\n\n if (name == 'style') {\n var css = '';\n value = extend({}, value);\n for (var styleProp in value) {\n css += paramCase(styleProp) + ': ' + value[styleProp] + '; ';\n }\n value = css.trim();\n }\n\n if (value instanceof softHook || value instanceof attrHook) {\n ret += ' ' + createAttribute(name, value.value, true);\n continue;\n }\n\n var attr = createAttribute(name, value);\n if (attr) ret += ' ' + attr;\n }\n\n return ret + '>';\n}\n\nfunction tagContent(node) {\n var innerHTML = node.properties.innerHTML;\n if (innerHTML != null) return innerHTML;\n else {\n var ret = '';\n if (node.children && node.children.length) {\n for (var i = 0, l = node.children.length; i';\n}\n","export default '/home/runner/work/plot/plot/ctor/lib/view/browser'","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar readfile = require( 'fs' ).readFile;\n\n\n// MAIN //\n\n/**\n* Asynchronously reads the entire contents of a file.\n*\n* @param {(string|Buffer|integer)} file - file path or file descriptor\n* @param {(Object|string)} [options] - options\n* @param {(string|null)} [options.encoding] - file encoding\n* @param {string} [options.flag] - file status flag\n* @param {Function} clbk - callback to invoke after reading file contents\n*\n* @example\n* function onFile( error, data ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( data );\n* }\n* readFile( __filename, onFile );\n*/\nfunction readFile() {\n\tvar args;\n\tvar i;\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treadfile.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default readFile;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar readfileSync = require( 'fs' ).readFileSync; // eslint-disable-line node/no-sync\n\n\n// MAIN //\n\n/**\n* Synchronously reads the entire contents of a file.\n*\n* @param {(string|Buffer|integer)} file - file path or file descriptor\n* @param {(Object|string)} [options] - options\n* @param {(string|null)} [options.encoding] - file encoding\n* @param {string} [options.flag] - file status flag\n* @returns {(Buffer|string|Error)} file contents or an error\n*\n* @example\n* var out = readFileSync( __filename );\n* if ( out instanceof Error ) {\n* throw out;\n* }\n* console.log( out );\n*/\nfunction readFileSync( file, options ) {\n\tvar f;\n\ttry {\n\t\tif ( arguments.length > 1 ) {\n\t\t\tf = readfileSync( file, options );\n\t\t} else {\n\t\t\tf = readfileSync( file );\n\t\t}\n\t} catch ( err ) {\n\t\treturn err;\n\t}\n\treturn f;\n}\n\n\n// EXPORTS //\n\nexport default readFileSync;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Read the entire contents of a file.\n*\n* @module @stdlib/fs/read-file\n*\n* @example\n* import readFile from '@stdlib/fs/read-file';\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( data );\n* }\n* readFile( __filename, onFile );\n*\n* @example\n* import { sync as readFileSync } from '@stdlib/fs/read-file';\n*\n* var out = readFileSync( __filename );\n* if ( out instanceof Error ) {\n* throw out;\n* }\n* console.log( out );\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport sync from './sync.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'sync', sync );\n\n\n// EXPORTS //\n\nexport default main;\n","export default '/home/runner/work/plot/plot/node_modules/@stdlib/net/disposable-http-server/lib'","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.port] - server port\n* @param {NonNegativeInteger} [options.maxport] - max server port\n* @param {string} [options.hostname] - server hostname\n* @param {string} [options.address] - server address\n* @returns {(Error|null)} error or null\n*\n* @example\n* var options = {\n* 'port': 7331,\n* 'address': '127.0.0.1'\n* };\n* var opts = {};\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'port' ) ) {\n\t\topts.port = options.port;\n\t\tif ( !isNonNegativeInteger( opts.port ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'port', opts.port ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'maxport' ) ) {\n\t\topts.maxport = options.maxport;\n\t\tif ( !isNonNegativeInteger( opts.maxport ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'maxport', opts.maxport ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'hostname' ) ) {\n\t\topts.hostname = options.hostname;\n\t\tif ( !isString( opts.hostname ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'hostname', opts.hostname ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'address' ) ) {\n\t\topts.address = options.address;\n\t\tif ( !isString( opts.address ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'address', opts.address ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar http = require( 'http' );\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\nimport validate from './validate.js';\nimport DEFAULTS from './defaults.json';\n\n\n// VARIABLES //\n\nvar debug = logger( './../../http-server' );\n\n\n// MAIN //\n\n/**\n* Returns a function which creates an HTTP server.\n*\n* @param {Options} [options] - server options\n* @param {NonNegativeInteger} [options.port=0] - server port\n* @param {NonNegativeInteger} [options.maxport] - max server port\n* @param {string} [options.hostname] - server hostname\n* @param {string} [options.address=\"127.0.0.1\"] - server address\n* @param {Callback} [requestListener] - callback invoked upon receiving an HTTP request\n* @throws {TypeError} `requestListener` must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Function} function which creates an HTTP server\n*\n* @example\n* var createServer = httpServer();\n*\n* @example\n* var opts = {\n* 'port': 7331,\n* 'address': '0.0.0.0'\n* };\n* var createServer = httpServer( opts );\n*\n* @example\n* var opts = {\n* 'port': 7331,\n* 'address': '0.0.0.0'\n* };\n* function onRequest( request, response ) {\n* console.log( request.url );\n* response.end( 'OK' );\n* }\n* var createServer = httpServer( opts, onRequest );\n*/\nfunction httpServer() {\n\tvar requestListener;\n\tvar hostname;\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar port;\n\tvar max;\n\tvar err;\n\n\tnargs = arguments.length;\n\topts = {};\n\tif ( nargs === 1 ) {\n\t\tif ( isFunction( arguments[0] ) ) {\n\t\t\trequestListener = arguments[ 0 ];\n\t\t} else {\n\t\t\toptions = arguments[ 0 ];\n\t\t\terr = validate( opts, options );\n\t\t}\n\t}\n\telse if ( nargs > 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\trequestListener = arguments[ 1 ];\n\t\tif ( !isFunction( requestListener ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Request listener must be a function. Value: `%s`.', requestListener ) );\n\t\t}\n\t\terr = validate( opts, options );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( opts.port === void 0 ) {\n\t\tport = DEFAULTS.port;\n\t} else {\n\t\tport = opts.port;\n\t}\n\tdebug( 'Server port: %d', port );\n\n\tif ( opts.maxport === void 0 ) {\n\t\tmax = port;\n\t} else {\n\t\tmax = opts.maxport;\n\t}\n\tdebug( 'Max server port: %d', max );\n\n\tif ( opts.hostname ) {\n\t\thostname = opts.hostname;\n\t}\n\telse if ( opts.address ) {\n\t\thostname = opts.address;\n\t}\n\telse {\n\t\thostname = DEFAULTS.address;\n\t}\n\tdebug( 'Server hostname: %s', hostname );\n\n\treturn createServer;\n\n\t/**\n\t* Creates an HTTP server.\n\t*\n\t* @private\n\t* @param {Callback} done - function to invoke after creating a server\n\t* @throws {TypeError} must provide a function\n\t*\n\t* @example\n\t* function done( error, server ) {\n\t* if ( error ) {\n\t* throw error;\n\t* }\n\t* console.log( 'Success!' );\n\t* server.close();\n\t* }\n\t* createServer( done );\n\t*/\n\tfunction createServer( done ) {\n\t\tvar server;\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\tif ( requestListener ) {\n\t\t\tserver = http.createServer( requestListener );\n\t\t} else {\n\t\t\tserver = http.createServer();\n\t\t}\n\t\tserver.on( 'error', errorListener );\n\t\tserver.once( 'listening', onListen );\n\n\t\tdebug( 'Attempting to listen on %s:%d.', hostname, port );\n\t\tserver.listen( port, hostname );\n\n\t\t/**\n\t\t* Server error event handler.\n\t\t*\n\t\t* @private\n\t\t* @param {Error} error - server error\n\t\t* @throws {Error} server error\n\t\t*/\n\t\tfunction errorListener( error ) {\n\t\t\tif ( error.code === 'EADDRINUSE' ) {\n\t\t\t\tdebug( 'Server address already in use: %s:%d.', hostname, port );\n\t\t\t\tport += 1;\n\t\t\t\tif ( port <= max ) {\n\t\t\t\t\tdebug( 'Attempting to listen on %s:%d.', hostname, port );\n\t\t\t\t\tserver.listen( port, hostname );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\n\t\t/**\n\t\t* Callback invoked once a server is listening and ready to handle requests.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction onListen() {\n\t\t\tvar addr = server.address();\n\t\t\tdebug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port );\n\t\t\tdone( null, server );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default httpServer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\n\n\n// MAIN //\n\n/**\n* Platform on which the current process is running.\n*\n* @constant\n* @type {string}\n*/\nvar PLATFORM = proc.platform;\n\n\n// EXPORTS //\n\nexport default PLATFORM;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean indicating if the current process is running on Windows.\n*\n* @module @stdlib/assert/is-windows\n* @type {boolean}\n*\n* @example\n* import PLATFORM from '@stdlib/os/platform';\n* import IS_WINDOWS from '@stdlib/assert/is-windows';\n*\n* if ( IS_WINDOWS ) {\n* console.log( 'Running on Windows...' );\n* } else {\n* console.log( 'Running on %s...', PLATFORM );\n* }\n*/\n\n// MODULES //\n\nimport PLATFORM from '@stdlib/os/platform';\n\n\n// MAIN //\n\n/**\n* Boolean indicating if the current process is running on Windows.\n*\n* @constant\n* @type {boolean}\n*/\nvar IS_WINDOWS = ( PLATFORM === 'win32' );\n\n\n// EXPORTS //\n\nexport default IS_WINDOWS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean indicating if the current process is running on Darwin.\n*\n* @module @stdlib/assert/is-darwin\n* @type {boolean}\n*\n* @example\n* import PLATFORM from '@stdlib/os/platform';\n* import IS_DARWIN from '@stdlib/assert/is-darwin';\n*\n* if ( IS_DARWIN ) {\n* console.log( 'Running on Darwin...' );\n* } else {\n* console.log( 'Running on %s...', PLATFORM );\n* }\n*/\n\n// MODULES //\n\nimport PLATFORM from '@stdlib/os/platform';\n\n\n// MAIN //\n\n/**\n* Boolean indicating if the current process is running on Darwin.\n*\n* @constant\n* @type {boolean}\n*/\nvar IS_DARWIN = ( PLATFORM === 'darwin' );\n\n\n// EXPORTS //\n\nexport default IS_DARWIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from './../../is-string';\n\n\n// VARIABLES //\n\n/**\n* Matches parts of a URI according to RFC 3986.\n*\n* ```text\n* : [ ? ] [ # ]\n* ```\n*\n* Regular expression: `/(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?[^#]*)?(?:#.*)?/`\n*\n* - `(?:([^:\\/?#]+):)`\n*\n* - match the scheme, including the `:`, but only capture the scheme name\n*\n* - `?`\n*\n* - match the scheme zero or one times\n*\n* - `(?:\\/\\/([^\\/?#]*))`\n*\n* - match the hierarchical part which is everything which is not a `/`, `#`, or `?`, but only capture whatever comes after the `//`\n*\n* - `?`\n*\n* - match the hierarchical part zero or one times\n*\n* - `([^?#]*)`\n*\n* - capture everything (the path) until meeting a `?` or `#`\n*\n* - `(?:\\?[^#]*)`\n*\n* - match, but don't capture, a query\n*\n* - `?`\n*\n* - match the query zero or one times\n*\n* - `(?:#.*)`\n*\n* - match, but don't capture, a fragment\n*\n* - `?`\n*\n* - match the fragment zero or one times\n*\n* @private\n* @constant\n* @type {RegExp}\n* @default /(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?[^#]*)?(?:#.*)?/\n*/\nvar RE_URI = /(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?[^#]*)?(?:#.*)?/; // eslint-disable-line no-useless-escape\n\n// Illegal characters (anything which is not in between the square brackets):\nvar RE_ILLEGALS = /[^a-z0-9:\\/?#\\[\\]@!$&'()*+,;=.\\-_~%]/i; // eslint-disable-line no-useless-escape\n\n// Incomplete HEX escapes:\nvar RE_HEX1 = /%[^0-9a-f]/i;\nvar RE_HEX2 = /%[0-9a-f](:?[^0-9a-f]|$)/i;\n\n// If authority is not present, path must not begin with '//'\nvar RE_PATH = /^\\/\\//;\n\n// Scheme must begin with a letter, then consist of letters, digits, '+', '.', or '-' => e.g., 'http', 'https', 'ftp'\nvar RE_SCHEME = /^[a-z][a-z0-9+\\-.]*$/;\n\n\n// MAIN //\n\n/**\n* Tests if a value is a URI.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a URI\n*\n* @example\n* var bool = isURI( 'http://google.com' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'http://localhost/' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'http://example.w3.org/path%20with%20spaces.html' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'http://example.w3.org/%20' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'ftp://ftp.is.co.za/../../../rfc/rfc1808.txt' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'http://www.ietf.org/rfc/rfc2396.txt' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'ldap://[2001:db8::7]/c=GB?objectClass?one' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'mailto:John.Doe@example.com' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'news:comp.infosystems.www.servers.unix' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'tel:+1-816-555-1212' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'telnet://192.0.2.16:80/' );\n* // returns true\n*\n* @example\n* var bool = isURI( 'urn:oasis:names:specification:docbook:dtd:xml:4.1.2' );\n* // returns true\n*\n* @example\n* // No scheme:\n* var bool = isURI( '' );\n* // returns false\n*\n* @example\n* // No scheme:\n* var bool = isURI( 'foo' );\n* // returns false\n*\n* @example\n* // No scheme:\n* var bool = isURI( 'foo@bar' );\n* // returns false\n*\n* @example\n* // No scheme:\n* var bool = isURI( '://foo/' );\n* // returns false\n*\n* @example\n* // Illegal characters:\n* var bool = isURI( 'http://' );\n* // returns false\n*\n* @example\n* // Invalid path:\n* var bool = isURI( 'http:////foo.html' );\n* // returns false\n*\n* @example\n* // Incomplete hex escapes...\n* var bool = isURI( 'http://example.w3.org/%a' );\n* // returns false\n*\n* @example\n* var bool = isURI( 'http://example.w3.org/%a/foo' );\n* // returns false\n*\n* @example\n* var bool = isURI( 'http://example.w3.org/%at' );\n* // returns false\n*/\nfunction isURI( value ) {\n\tvar authority;\n\tvar scheme;\n\tvar parts;\n\tvar path;\n\n\tif ( !isString( value ) ) {\n\t\treturn false;\n\t}\n\t// Check for illegal characters:\n\tif ( RE_ILLEGALS.test( value ) ) {\n\t\treturn false;\n\t}\n\t// Check for incomplete HEX escapes:\n\tif (\n\t\tRE_HEX1.test( value ) ||\n\t\tRE_HEX2.test( value )\n\t) {\n\t\treturn false;\n\t}\n\t// Split the string into various URI components:\n\tparts = value.match( RE_URI );\n\tscheme = parts[ 1 ];\n\tauthority = parts[ 2 ];\n\tpath = parts[ 3 ];\n\n\t// Scheme is required and must be valid:\n\tif (\n\t\t!scheme ||\n\t\t!scheme.length ||\n\t\t!RE_SCHEME.test( scheme.toLowerCase() )\n\t) {\n\t\treturn false;\n\t}\n\t// If authority is not present, path must not begin with `//`:\n\tif (\n\t\t!authority &&\n\t\tRE_PATH.test( path )\n\t) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default isURI;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar spawn = require( 'child_process' ).spawn;\nimport IS_WINDOWS from '@stdlib/assert/is-windows';\nimport IS_DARWIN from '@stdlib/assert/is-darwin';\nimport format from '@stdlib/string/format';\nimport isURI from '@stdlib/assert/is-uri';\n\n\n// VARIABLES //\n\nvar ARGS;\nvar CMD;\n\n// Mac:\nif ( IS_DARWIN ) {\n\tCMD = 'open';\n\tARGS = [];\n}\n// On Windows, ideally, we would use the `start` command; however, the rules regarding argument spacing and escaping are complex. Instead, we can use `cmd /c` which has built-in logic to address these rules.\nelse if ( IS_WINDOWS ) {\n\tCMD = 'cmd';\n\n\t// `cmd /c` interprets double-quoted first parameters as window titles. To work around this, we explicitly provide an empty string for the window title.\n\tARGS = [ '/c', 'start', '\"\"' ];\n}\n// All other `*nix` flavors:\nelse {\n\tCMD = 'xdg-open';\n\tARGS = [];\n}\n\n\n// MAIN //\n\n/**\n* Opens a URL.\n*\n* @param {string} url - URL to open\n* @throws {TypeError} must provide a valid URI\n* @returns {Process} spawned process (unreferenced)\n*\n* @example\n* var proc = openURL( 'https://google.com' );\n*/\nfunction openURL( url ) {\n\tvar args;\n\tvar proc;\n\tvar i;\n\tif ( !isURI( url ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a valid URI. Value: `%s`.', url ) );\n\t}\n\targs = new Array( ARGS.length );\n\tfor ( i = 0; i < ARGS.length; i++ ) {\n\t\targs[ i ] = ARGS[ i ];\n\t}\n\tif ( IS_WINDOWS ) {\n\t\t// `&` characters must be escaped when passed to `start`:\n\t\turl = url.replace( /&/g, '^&' );\n\t}\n\targs.push( url );\n\n\t// Spawn a child process to open the URL:\n\tproc = spawn( CMD, args, {} );\n\n\t// To prevent the parent process waiting on the child process, we unreference the process to remove it from the parent's reference count:\n\tproc.unref();\n\n\treturn proc;\n}\n\n\n// EXPORTS //\n\nexport default openURL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Allocate a buffer containing a provided string.\n*\n* @module @stdlib/buffer/from-string\n*\n* @example\n* import string2buffer from '@stdlib/buffer/from-string';\n*\n* var buf = string2buffer( 'beep boop' );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFrom from './has_from.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar string2buffer;\nif ( hasFrom ) {\n\tstring2buffer = main;\n} else {\n\tstring2buffer = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default string2buffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\nvar bool = isFunction( Buffer.from );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer containing a provided string.\n*\n* @param {string} str - input string\n* @param {string} [encoding=\"utf8\"] - character encoding\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a string\n* @throws {TypeError} second argument must be a valid encoding\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = fromString( 'beep boop' );\n* // returns \n*/\nfunction fromString( str, encoding ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isString( encoding ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', encoding ) );\n\t\t}\n\t\treturn Buffer.from( str, encoding );\n\t}\n\treturn Buffer.from( str, 'utf8' );\n}\n\n\n// EXPORTS //\n\nexport default fromString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\nimport Buffer from './../../ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer containing a provided string.\n*\n* @param {string} str - input string\n* @param {string} [encoding=\"utf8\"] - character encoding\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a string\n* @throws {TypeError} second argument must be a valid encoding\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = fromString( 'beep boop' );\n* // returns \n*/\nfunction fromString( str, encoding ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isString( encoding ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', encoding ) );\n\t\t}\n\t\treturn new Buffer( str, encoding );\n\t}\n\treturn new Buffer( str, 'utf8' );\n}\n\n\n// EXPORTS //\n\nexport default fromString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\n\n\n// MAIN //\n\n/**\n* Adds a callback to the \"next tick queue\".\n*\n* ## Notes\n*\n* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.\n*\n* @param {Callback} clbk - callback\n* @param {...*} [args] - arguments to provide to the callback upon invocation\n*\n* @example\n* function beep() {\n* console.log( 'boop' );\n* }\n*\n* nextTick( beep );\n*/\nfunction nextTick( clbk ) {\n\tvar args;\n\tvar i;\n\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\tproc.nextTick( wrapper );\n\n\t/**\n\t* Callback wrapper.\n\t*\n\t* ## Notes\n\t*\n\t* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.\n\t*\n\t* @private\n\t*/\n\tfunction wrapper() {\n\t\tclbk.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default nextTick;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar path = require( 'path' );\nvar logger = require( 'debug' );\nimport objectKeys from '@stdlib/utils/keys';\nimport createServer from './../../http-server';\nimport { sync as readFileSync } from '@stdlib/fs/read-file';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport openURL from '@stdlib/utils/open-url';\nimport noop from '@stdlib/utils/noop';\nimport Buffer from '@stdlib/buffer/ctor';\nimport string2buffer from '@stdlib/buffer/from-string';\nimport nextTick from '@stdlib/utils/next-tick';\nimport format from '@stdlib/string/format';\nimport validate from './validate.js';\nimport serverOpts from './opts.js';\nimport createStore from './connections_store.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'disposable-http-server' );\n\n\n// MAIN //\n\n/**\n* Creates a disposable HTTP server.\n*\n* @param {Options} options - server options\n* @param {(Buffer|string)} [options.html] - HTML content to serve\n* @param {(Buffer|string)} [options.javascript] - JavaScript to serve\n* @param {NonNegativeInteger} [options.port=0] - server port\n* @param {NonNegativeInteger} [options.maxport] - max server port\n* @param {string} [options.hostname] - server hostname\n* @param {string} [options.address=\"0.0.0.0\"] - server address\n* @param {boolean} [options.open=false] - boolean indicating whether to launch a web browser\n* @param {Callback} [clbk] - callback to invoke upon creating a server\n* @throws {TypeError} must provide valid options\n* @throws {Error} error encountered when starting server\n*\n* @example\n* var opts = {\n* 'html': '

Beep

'\n* };\n*\n* httpServer( opts, onReady );\n*\n* function onReady( error, server ) {\n* if ( error ) {\n* throw error;\n* }\n* server.close();\n* }\n*/\nfunction httpServer( options ) {\n\tvar connections;\n\tvar isClosing;\n\tvar server;\n\tvar sopts;\n\tvar fpath;\n\tvar clbk;\n\tvar boot;\n\tvar opts;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t} else {\n\t\tclbk = noop;\n\t}\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\t// If provided HTML and/or JavaScript as `strings`, convert to `buffers`...\n\tif ( opts.html && isString( opts.html ) ) {\n\t\topts.html = string2buffer( opts.html );\n\t}\n\tif ( opts.javascript && isString( opts.javascript ) ) {\n\t\topts.javascript = string2buffer( opts.javascript );\n\t}\n\t// Extract server options:\n\tsopts = serverOpts( options );\n\n\tdebug( 'Serving provided content.' );\n\tif ( !opts.html ) {\n\t\tdebug( 'No HTML content provided.' );\n\t\tdebug( 'Loading a boilerplate HTML page...' );\n\t\tfpath = path.resolve( __dirname, '../static/index.html' );\n\t\topts.html = readFileSync( fpath );\n\t}\n\t// Create a function to boot a server...\n\tboot = createServer( sopts, requestListener );\n\n\tdebug( 'Starting server...' );\n\tboot( onServer );\n\n\t// Initialize a connections store:\n\tconnections = createStore();\n\n\t/**\n\t* Callback invoked upon creating a server.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {Server} _server - server instance\n\t* @throws {Error} error encountered when starting server\n\t*/\n\tfunction onServer( error, _server ) {\n\t\tvar addr;\n\t\tif ( error ) {\n\t\t\tthrow error;\n\t\t}\n\t\tdebug( 'Server started.' );\n\t\tserver = _server;\n\t\tserver.on( 'connection', onConnection );\n\t\tserver.once( 'close', onClose );\n\t\tif ( opts.open ) {\n\t\t\taddr = server.address();\n\t\t\topenURL( 'http://'+addr.address+':'+addr.port );\n\t\t}\n\t\tclbk( null, server );\n\t}\n\n\t/**\n\t* Callback invoked upon receiving a socket connection.\n\t*\n\t* @private\n\t* @param {Socket} socket - socket connection\n\t*/\n\tfunction onConnection( socket ) {\n\t\tvar key = socket.remoteAddress + ':' + socket.remotePort;\n\n\t\tdebug( 'Received a socket connection: %s.', key );\n\t\tconnections[ key ] = socket;\n\t\tsocket.on( 'close', onClose );\n\n\t\t/**\n\t\t* Callback invoked once a socket connection closes.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction onClose() {\n\t\t\tdebug( 'Socket connection closed: %s.', key );\n\t\t\tdelete connections[ key ];\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked upon receiving an HTTP request for provided content.\n\t*\n\t* @private\n\t* @param {IncomingMessage} request - HTTP request object\n\t* @param {ServerResponse} response - HTTP response object\n\t* @returns {void}\n\t*/\n\tfunction requestListener( request, response ) {\n\t\tdebug( 'Received a request for %s', request.url );\n\n\t\tif ( isClosing ) {\n\t\t\treturn unavailable( request, response );\n\t\t}\n\t\tif ( request.url === '/bundle.js' ) {\n\t\t\tnextTick( onTick( sendJavaScript ) );\n\t\t\treturn response.once( 'finish', onFinish );\n\t\t}\n\t\tif ( request.url !== '/' && request.url !== '/index.html' ) {\n\t\t\treturn notFound( request, response );\n\t\t}\n\t\tnextTick( onTick( sendHTML ) );\n\t\tif ( !opts.javascript ) {\n\t\t\tresponse.once( 'finish', onFinish );\n\t\t}\n\n\t\t/**\n\t\t* Returns a callback to return a response on the next tick. Note that this is a workaround for a race condition bug in Node v0.10 (see [nodejs/node#1309][1]).\n\t\t*\n\t\t* [1]: https://github.com/nodejs/node/issues/1309\n\t\t*\n\t\t* @private\n\t\t* @param {Function} fcn - response function\n\t\t* @returns {Callback} callback to invoke on next tick\n\t\t*/\n\t\tfunction onTick( fcn ) {\n\t\t\treturn next;\n\n\t\t\t/**\n\t\t\t* Callback to return on a response.\n\t\t\t*\n\t\t\t* @private\n\t\t\t*/\n\t\t\tfunction next() {\n\t\t\t\tfcn( request, response );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Sends a 404 response.\n\t*\n\t* @private\n\t* @param {IncomingMessage} request - HTTP request object\n\t* @param {ServerResponse} response - HTTP response object\n\t*/\n\tfunction notFound( request, response ) {\n\t\tdebug( 'Sending 404 response...' );\n\t\tresponse.statusCode = 404;\n\t\tresponse.end();\n\t}\n\n\t/**\n\t* Sends a 503 response.\n\t*\n\t* @private\n\t* @param {IncomingMessage} request - HTTP request object\n\t* @param {ServerResponse} response - HTTP response object\n\t*/\n\tfunction unavailable( request, response ) {\n\t\tdebug( 'Sending 503 response...' );\n\t\tresponse.statusCode = 503;\n\t\tresponse.end();\n\t}\n\n\t/**\n\t* Sends HTML content in response to a client request.\n\t*\n\t* @private\n\t* @param {IncomingMessage} request - HTTP request object\n\t* @param {ServerResponse} response - HTTP response object\n\t*/\n\tfunction sendHTML( request, response ) {\n\t\tdebug( 'Sending HTML...' );\n\t\tresponse.statusCode = 200;\n\t\tresponse.setHeader( 'Content-Type', 'text/html' );\n\n\t\t// TODO: we have to convert to a `string` because Node v0.10 requires a `string`. Subsequent versions support providing a `Buffer` object. Ideally, we would sniff `Buffer` support and only convert to a `string` if necessary.\n\t\tresponse.setHeader( 'Content-Length', Buffer.byteLength( opts.html.toString() ) );\n\t\tresponse.end( opts.html );\n\t}\n\n\t/**\n\t* Sends JavaScript content in response to a client request.\n\t*\n\t* @private\n\t* @param {IncomingMessage} request - HTTP request object\n\t* @param {ServerResponse} response - HTTP response object\n\t*/\n\tfunction sendJavaScript( request, response ) {\n\t\tdebug( 'Sending JavaScript...' );\n\t\tresponse.statusCode = 200;\n\t\tresponse.setHeader( 'Content-Type', 'text/javascript' );\n\n\t\t// TODO: we have to convert to a `string` because Node v0.10 requires a `string`. Subsequent versions support providing a `Buffer` object. Ideally, we would sniff `Buffer` support and only convert to a `string` if necessary.\n\t\tresponse.setHeader( 'Content-Length', Buffer.byteLength( opts.javascript.toString() ) );\n\t\tresponse.end( opts.javascript );\n\t}\n\n\t/**\n\t* Callback invoked once the server should close.\n\t*\n\t* @private\n\t*/\n\tfunction onFinish() {\n\t\tdebug( 'Finished serving content.' );\n\t\tisClosing = true;\n\n\t\tdebug( 'Closing the server...' );\n\t\tserver.close();\n\n\t\tsetTimeout( destroyConnections, 5000 );\n\t}\n\n\t/**\n\t* Destroys all connections.\n\t*\n\t* @private\n\t*/\n\tfunction destroyConnections() {\n\t\tvar keys;\n\t\tvar i;\n\n\t\tdebug( 'Destroying all connections...' );\n\t\tkeys = objectKeys( connections );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\tdebug( 'Destroying connection %s...', keys[i] );\n\t\t\tconnections[ keys[i] ].destroy();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a server closes.\n\t*\n\t* @private\n\t*/\n\tfunction onClose() {\n\t\tdebug( 'Server closed.' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default httpServer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert/is-buffer';\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {(Buffer|string)} [options.html] - HTML content to serve\n* @param {(Buffer|string)} [options.javascript] - JavaScript script to serve\n* @param {boolean} [options.open] - indicates whether to launch a web browser\n* @returns {Error|null} error or null\n*\n* @example\n* var options = {\n* 'port': 7331,\n* 'address': '127.0.0.1',\n* 'open': false\n* };\n* var opts = {};\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'html' ) ) {\n\t\topts.html = options.html;\n\t\tif ( !isBuffer( opts.html ) && !isString( opts.html ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be either a Buffer or a string. Option: `%s`.', 'html', opts.html ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'javascript' ) ) {\n\t\topts.javascript = options.javascript;\n\t\tif ( !isBuffer( opts.javascript ) && !isString( opts.javascript ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be either a Buffer or a string. Option: `%s`.', 'javascript', opts.javascript ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'open' ) ) {\n\t\topts.open = options.open;\n\t\tif ( !isBoolean( opts.open ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'open', opts.open ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert/has-own-property';\n\n\n// MAIN //\n\n/**\n* Extracts HTTP server options from input function options.\n*\n* @private\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.port] - server port\n* @param {NonNegativeInteger} [options.maxport] - max server port\n* @param {string} [options.hostname] - server hostname\n* @param {string} [options.address] - server address\n* @returns {Options} server options\n*\n* @example\n* var options = {\n* 'html': '

beep

',\n* 'open': true,\n* 'port': 7331,\n* 'address': '127.0.0.1'\n* };\n* var out = opts( options );\n* // returns {'port': 7331, 'address': '127.0.0.1'}\n*/\nfunction opts( options ) {\n\tvar out = {};\n\tif ( hasOwnProp( options, 'port' ) ) {\n\t\tout.port = options.port;\n\t}\n\tif ( hasOwnProp( options, 'maxport' ) ) {\n\t\tout.maxport = options.maxport;\n\t}\n\tif ( hasOwnProp( options, 'hostname' ) ) {\n\t\tout.hostname = options.hostname;\n\t}\n\tif ( hasOwnProp( options, 'address' ) ) {\n\t\tout.address = options.address;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default opts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a new connections store.\n*\n* @private\n* @returns {Object} store\n*/\nfunction create() {\n\treturn {};\n}\n\n\n// EXPORTS //\n\nexport default create;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar path = require( 'path' );\nvar toHTML = require( 'vdom-to-html' );\nimport { sync as readFileSync } from '@stdlib/fs/read-file';\nimport httpServer from '@stdlib/net/disposable-http-server';\n\n\n// MAIN //\n\n/**\n* Opens a plot in a browser window.\n*\n* @private\n* @param {VTree} vtree - virtual DOM tree\n*/\nfunction view( vtree ) {\n\tvar index;\n\tvar html;\n\n\t// Transform the virtual DOM tree to HTML:\n\thtml = toHTML( vtree );\n\n\t// Inject the HTML:\n\tindex = path.join( __dirname, 'index.html' );\n\tindex = readFileSync( index, {\n\t\t'encoding': 'utf8'\n\t});\n\n\tindex = index.replace( /\\{\\{plot\\}\\}/, html );\n\n\t// Create a disposable HTTP server:\n\thttpServer({\n\t\t'html': index,\n\t\t'open': true\n\t});\n}\n\n\n// EXPORTS //\n\nexport default view;\n","export default '/home/runner/work/plot/plot/ctor/lib/view/electron'","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\n\n\n// MAIN //\n\n/**\n* An object containing the user environment.\n*\n* @name ENV\n* @type {Object}\n*\n* @example\n* console.dir( ENV );\n*/\nvar ENV = proc.env;\n\n\n// EXPORTS //\n\nexport default ENV;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: refactor. Remove disposable server. Create a server in the electron process and have it serve assets from local directories. Should be similar to SimpleServer.\n\n// MODULES //\n\nvar spawn = require( 'child_process' ).spawn;\nvar path = require( 'path' );\nvar logger = require( 'debug' );\nvar toHTML = require( 'vdom-to-html' );\nimport instanceOf from '@stdlib/assert/instance-of';\nimport ENV from '@stdlib/process/env';\nimport copy from '@stdlib/utils/copy';\nimport merge from '@stdlib/utils/merge';\nimport { sync as readFileSync } from '@stdlib/fs/read-file';\nimport httpServer from '@stdlib/net/disposable-http-server';\nimport tryRequire from '@stdlib/utils/try-require';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:view:electron:main' );\nvar electron = tryRequire( '@stdlib/electron' );\n\n\n// MAIN //\n\n/**\n* Opens a plot in an electron window.\n*\n* @private\n* @param {Plot} plot - plot context\n* @param {VTree} vtree - virtual tree\n* @throws {Error} Electron must be properly installed\n*/\nfunction view( plot, vtree ) {\n\tvar index;\n\tvar html;\n\tvar opts;\n\tvar css;\n\n\tif ( instanceOf( electron, Error ) ) {\n\t\tthrow new Error( 'invalid operation. Unable to load Electron. Ensure Electron is installed and try again.' );\n\t}\n\tdebug( 'Transforming virtual DOM tree to HTML...' );\n\thtml = toHTML( vtree );\n\n\t// Define `fs` options:\n\topts = {\n\t\t'encoding': 'utf8'\n\t};\n\n\tdebug( 'Injecting HTML into HTML template...' );\n\tindex = path.join( __dirname, 'index.html' );\n\tindex = readFileSync( index, opts );\n\tindex = index.replace( /\\{\\{plot\\}\\}/, html );\n\n\tdebug( 'Injecting CSS into HTML template...' );\n\tcss = path.join( __dirname, 'css', 'reset.css' );\n\tcss = readFileSync( css, opts );\n\tindex = index.replace( /\\{\\{reset\\}\\}/, css );\n\n\tcss = path.join( __dirname, 'css', 'colors.css' );\n\tcss = readFileSync( css, opts );\n\tindex = index.replace( /\\{\\{colors\\}\\}/, css );\n\n\tcss = path.join( __dirname, 'css', 'styles.css' );\n\tcss = readFileSync( css, opts );\n\tindex = index.replace( /\\{\\{styles\\}\\}/, css );\n\n\tdebug( 'Creating a disposable HTTP server...' );\n\topts = {\n\t\t'html': index,\n\t\t'open': false\n\t};\n\thttpServer( opts, onReady );\n\n\t/**\n\t* Callback invoked once a server is ready to receive requests.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {Server} server - HTTP server\n\t* @throws {Error} unexpected error\n\t*/\n\tfunction onReady( error, server ) {\n\t\tvar child;\n\t\tvar addr;\n\t\tvar opts;\n\t\tvar env;\n\t\tif ( error ) {\n\t\t\tthrow error;\n\t\t}\n\t\taddr = server.address();\n\t\tdebug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port );\n\n\t\tdebug( 'Electron executable: %s.', electron );\n\n\t\t// TODO: extract fixed env vars to config file and then won't need to pass via environment variables, but can simply require\n\t\tenv = {\n\t\t\t'SERVER_PORT': addr.port,\n\t\t\t'SERVER_ADDRESS': addr.address,\n\t\t\t'PLOT_WIDTH': plot.width,\n\t\t\t'PLOT_HEIGHT': plot.height,\n\t\t\t'PLOT_APP_PATH': __dirname,\n\t\t\t'PLOT_MIN_WIDTH': 100,\n\t\t\t'PLOT_MIN_HEIGHT': 100,\n\t\t\t'PLOT_TITLE': plot.title || 'stdlib'\n\t\t};\n\t\tdebug( 'Electron process environment variables: %s.', JSON.stringify( env ) );\n\n\t\topts = {\n\t\t\t'cwd': __dirname,\n\t\t\t'detached': true,\n\t\t\t'stdio': 'ignore'\n\t\t};\n\t\tdebug( 'Electron process options: %s.', JSON.stringify( opts ) );\n\n\t\t// Merge the current process' environment variables:\n\t\topts.env = merge( {}, copy( ENV ), env );\n\n\t\tdebug( 'Spawning an electron process...' );\n\t\tchild = spawn( electron, [ './main.js' ], opts );\n\t\tchild.unref();\n\t}\n}\n\n\n// EXPORTS //\n\nexport default view;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isError from '@stdlib/assert/is-error';\n\n\n// MAIN //\n\n/**\n* Wraps `require` in a try/catch block.\n*\n* @param {string} id - module id\n* @returns {*|Error} `module.exports` of the resolved module or an error\n*\n* @example\n* var out = tryRequire( 'beepboop' );\n*\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* }\n*/\nfunction tryRequire( id ) {\n\ttry {\n\t\treturn require( id ); // eslint-disable-line stdlib/no-dynamic-require\n\t} catch ( error ) {\n\t\tif ( isError( error ) ) {\n\t\t\treturn error;\n\t\t}\n\t\t// Handle case where a literal is thrown...\n\t\tif ( typeof error === 'object' ) {\n\t\t\treturn new Error( JSON.stringify( error ) );\n\t\t}\n\t\treturn new Error( error.toString() );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default tryRequire;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport stdout from './stdout';\nimport browser from './browser';\nimport electron from './electron';\n\n\n// MAIN //\n\n/**\n* Generates a plot view.\n*\n* @private\n* @param {Plot} plot - plot context\n* @param {string} viewer - plot viewer\n* @param {VTree} vtree - virtual\n* @returns {void}\n*/\nfunction view( plot, viewer, vtree ) {\n\tif ( viewer === 'none' ) {\n\t\treturn;\n\t}\n\tif ( viewer === 'stdout' ) {\n\t\treturn stdout( vtree );\n\t}\n\tif ( viewer === 'browser' ) {\n\t\treturn browser( vtree );\n\t}\n\tif ( viewer === 'terminal' ) {\n\t\t// TODO: ASCII\n\t\treturn;\n\t}\n\t// viewer === 'window'\n\telectron( plot, vtree );\n}\n\n\n// EXPORTS //\n\nexport default view;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Writes a plot (rendered as a virtual DOM tree) to `stdout`.\n*\n* @private\n* @param {VTree} plot - virtual tree\n*/\nfunction view( plot ) {\n\tconsole.log( JSON.stringify( plot ) );\n}\n\n\n// EXPORTS //\n\nexport default view;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar toStr = Object.prototype.toString;\n\n\n// MAIN //\n\n/**\n* Returns the internal class of a provided value.\n*\n* @private\n* @param {*} value - input value\n* @returns {string} internal class\n*/\nfunction toString( value ) { // eslint-disable-line stdlib/no-redeclare\n\treturn toStr.call( value );\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar Global;\n\n\n// FUNCTIONS //\n\n/**\n* Test if the global scope is bound to the \"global\" variable present in Node.js environments. When creating a new function using the `Function(){}` constructor, the execution scope aliased by the `this` variable is the global scope.\n*\n* @private\n* @returns {boolean} boolean indicating if global scope is bound to \"global\" variable\n*/\nfunction globalScope() {\n\tvar fcn = '';\n\tfcn += 'try {';\n\tfcn += 'return this === global;';\n\tfcn += '} catch ( err ) {';\n\tfcn += 'return false;';\n\tfcn += '}';\n\treturn (new Function( fcn ))(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// MAIN //\n\nGlobal = globalScope();\n\n\n// EXPORTS //\n\nexport default Global;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\nimport getGlobal from '@stdlib/utils/global';\nimport nativeClass from '@stdlib/utils/native-class';\nimport isObject from './../../is-plain-object';\nimport { isPrimitive as isString } from './../../is-string';\nimport toStr from './to_string.js';\nimport globalScope from './global_scope.js';\n\n\n// VARIABLES //\n\nvar Global = getGlobal();\nvar RE = /node|io\\.js/;\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if the runtime is Node.js.\n*\n* @returns {boolean} boolean indicating if runtime is Node.js\n*\n* @example\n* var bool = isNode();\n* // returns \n*/\nfunction isNode() {\n\treturn (\n\t\t// Check for presence of `global` variable:\n\t\ttypeof global === 'object' &&\n\n\t\t// Check that the `global` variable matches the determined global variable:\n\t\tglobal === Global &&\n\n\t\t// Check for a circular reference to the global variable:\n\t\tGlobal === Global.global &&\n\n\t\t// Check that the global variable has the expected internal class:\n\t\t(\n\t\t\t// Node < v7\n\t\t\tnativeClass( Global ) === '[object global]' ||\n\n\t\t\t// Node >= v7 (https://github.com/nodejs/node/issues/9274)\n\t\t\tnativeClass( Global ) === '[object Object]'\n\t\t) &&\n\n\t\t// Check that the `global` variable is equal to the global scope:\n\t\tglobalScope === true &&\n\n\t\t// Check for a `require` global variable:\n\t\ttypeof require === 'function' &&\n\n\t\t// Check for a `process` global variable:\n\t\ttypeof proc === 'object' &&\n\n\t\t// Check that the `process` global variable has the expected internal class (NOTE: we use `toStr`, rather than `nativecClass` to address changes introduced in Node >= v14.6.0; see https://github.com/stdlib-js/stdlib/issues/375):\n\t\ttoStr( proc ) === '[object process]' &&\n\n\t\t// Check for a `versions` property:\n\t\tisObject( proc.versions ) &&\n\n\t\t// Check for a `node` property:\n\t\tisString( proc.versions.node ) &&\n\n\t\t/* eslint-disable node/no-unsupported-features/es-builtins */\n\t\t(\n\t\t\t// `process.release` was added in Node v3.0.0 via io.js:\n\t\t\ttypeof proc.release === 'undefined' ||\n\n\t\t\t(\n\t\t\t\t// Check for a `release` property:\n\t\t\t\tisObject( proc.release ) &&\n\n\t\t\t\t// Check for a `name` property:\n\t\t\t\tisString( proc.release.name ) &&\n\n\t\t\t\t// Check that the release name contains either `node` or `io.js` (in Node.js/io.js, the release name is read-only):\n\t\t\t\tRE.test( proc.release.name )\n\t\t\t)\n\t\t)\n\t\t/* eslint-enable node/no-unsupported-features/es-builtins */\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNode;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean indicating if the runtime is Node.js.\n*\n* @module @stdlib/assert/is-node\n*\n* @example\n* import IS_NODE from '@stdlib/assert/is-node';\n*\n* var bool = IS_NODE;\n* // returns \n*/\n\n// MODULES //\n\nimport main from './main.js';\n\n\n// MAIN //\n\nvar bool = main();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport IS_NODE from './../../is-node';\nimport p from './parent.js';\nimport stacktrace from './stacktrace.js';\n\n\n// VARIABLES //\n\n// The module id for the builtin REPL was `repl` in Node versions <4 and then changed to `` for Node versions >=4 (see https://github.com/nodejs/node/commit/ee72ee753118f2576bfd1ccf58fb2ff651e8bfb0#diff-b13d72249263845d8e8341db0426f9d3R527).\nvar RE_MODULE_ID = /^repl$|^$/;\n\n// This is V8 specific (!!), as this assumes the V8 stacktrace API. TODO: rely on an engine agnostic approach to determining callsites.\nvar RE_ERROR_STACK = /at REPLServer/;\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if the function is called from a Node.js REPL environment.\n*\n* ## Notes\n*\n* - False positives are possible due to the existence of a userland package having the same module `id` (see [repl][repl-template-lib]) as the builtin Node.js `repl`.\n*\n* [repl-template-lib]: https://www.npmjs.com/package/repl\n*\n* @returns {boolean} boolean indicating if the function is called from a Node.js REPL environment\n*\n* @example\n* var bool = isNodeREPL();\n* // returns \n*/\nfunction isNodeREPL() {\n\tvar stack;\n\tvar m;\n\tif ( !IS_NODE ) {\n\t\treturn false;\n\t}\n\t// If this module was required in a REPL environment, we can walk up the module dependency tree to find a `repl` ancestor...\n\tm = p();\n\twhile ( m ) {\n\t\tif ( RE_MODULE_ID.test( m.id ) ) {\n\t\t\treturn true;\n\t\t}\n\t\tm = m.parent;\n\t}\n\t// Unable to find a `repl` ancestor, so try determining if this function was called from a REPL environment...\n\tstack = stacktrace();\n\tif ( stack ) {\n\t\treturn RE_ERROR_STACK.test( stack );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNodeREPL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the parent module.\n*\n* @private\n* @returns {Module} parent module\n*/\nfunction parent() { // eslint-disable-line stdlib/no-redeclare\n\treturn module;\n}\n\n\n// EXPORTS //\n\nexport default parent;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a stacktrace.\n*\n* @private\n* @returns {(string|void)} stacktrace\n*/\nfunction stacktrace() {\n\tvar err = new Error();\n\treturn err.stack;\n}\n\n\n// EXPORTS //\n\nexport default stacktrace;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isnan } from '@stdlib/assert/is-nan';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:accessor:is-defined' );\n\n\n// MAIN //\n\n/**\n* Accessor function which determines whether a datum is defined.\n*\n* @private\n* @param {number} d - datum\n* @param {integer} i - index\n* @returns {boolean} boolean indicating whether a datum is defined\n*/\nfunction isDefined( d ) {\n\tvar bool = !isnan( d );\n\tdebug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool );\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isDefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArray from '@stdlib/assert/is-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x' );\n\n\n// MAIN //\n\n/**\n* Sets the plot `x` values.\n*\n* @private\n* @param {Array} x - x values\n* @throws {TypeError} must be an array\n* @returns {void}\n*/\nfunction set( x ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArray( x ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array. Value: `%s`.', 'x', x ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xData ) );\n\n\tthis._xData = x.slice();\n\tdebug( 'New Value: %s.', JSON.stringify( this._xData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArray from '@stdlib/assert/is-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y' );\n\n\n// MAIN //\n\n/**\n* Sets the plot `y` values.\n*\n* @private\n* @param {Array} y - y values\n* @throws {TypeError} must be an array\n* @returns {void}\n*/\nfunction set( y ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArray( y ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array. Value: `%s`.', 'y', y ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yData ) );\n\n\tthis._yData = y.slice();\n\tdebug( 'New Value: %s.', JSON.stringify( this._yData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isEmptyArray from '@stdlib/assert/is-empty-array';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:labels' );\n\n\n// MAIN //\n\n/**\n* Sets the data labels.\n*\n* @private\n* @param {(StringArray|EmptyArray)} labels - data labels\n* @throws {TypeError} must be either an array of strings or an empty array\n* @returns {void}\n*/\nfunction set( labels ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isEmptyArray( labels ) &&\n\t\t!isStringArray( labels )\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array of strings or an empty array. Value: `%s`.', 'labels', labels ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._labels ) );\n\n\tthis._labels = labels.slice();\n\tdebug( 'New Value: %s.', JSON.stringify( this._labels ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:is-defined' );\n\n\n// MAIN //\n\n/**\n* Sets the accessor for defined values.\n*\n* @private\n* @param {Function} fcn - accessor\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) );\n\t}\n\tif ( fcn !== this._isDefined ) {\n\t\tdebug( 'Current value: %s.', this._isDefined );\n\n\t\tthis._isDefined = fcn;\n\t\tdebug( 'New Value: %s.', this._isDefined );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* See [D3]{@link https://github.com/d3/d3-scale/blob/master/README.md}.\n*/\n\nvar COLORS = {};\n\nCOLORS.category10 = [\n\t'#1f77b4', // 'category10-1'\n\t'#ff7f0e', // 'category10-2'\n\t'#2ca02c', // 'category10-3'\n\t'#d62728', // 'category10-4'\n\t'#9467bd', // 'category10-5'\n\t'#8c564b', // 'category10-6'\n\t'#e377c2', // 'category10-7'\n\t'#7f7f7f', // 'category10-8'\n\t'#bcdb22', // 'category10-9'\n\t'#17becf' // 'category10-10'\n];\n\nCOLORS.category20 = [\n\t'#1f77b4', // 'category20-1'\n\t'#aec7e8', // 'category20-2'\n\t'#ff7f0e', // 'category20-3'\n\t'#ffbb78', // 'category20-4'\n\t'#2ca02c', // 'category20-5'\n\t'#98df8a', // 'category20-6'\n\t'#d62728', // 'category20-7'\n\t'#ff9896', // 'category20-8'\n\t'#9467bd', // 'category20-9'\n\t'#c5b0d5', // 'category20-10'\n\t'#8c564b', // 'category20-11'\n\t'#c49c94', // 'category20-12'\n\t'#e377c2', // 'category20-13'\n\t'#f7b6d2', // 'category20-14'\n\t'#7f7f7f', // 'category20-15'\n\t'#c7c7c7', // 'category20-16'\n\t'#bcbd22', // 'category20-17'\n\t'#dbdb8d', // 'category20-18'\n\t'#17becf', // 'category20-19'\n\t'#9edae5' // 'category20-20'\n];\n\nCOLORS.category20b = [\n\t'#393b79', // 'category20b-1'\n\t'#5254a3', // 'category20b-2'\n\t'#6b6ecf', // 'category20b-3'\n\t'#9c9ede', // 'category20b-4'\n\t'#637939', // 'category20b-5'\n\t'#8ca252', // 'category20b-6'\n\t'#b5cf6b', // 'category20b-7'\n\t'#cedb9c', // 'category20b-8'\n\t'#8c6d31', // 'category20b-9'\n\t'#bd9e39', // 'category20b-10'\n\t'#e7ba52', // 'category20b-11'\n\t'#e7cb94', // 'category20b-12'\n\t'#843c39', // 'category20b-13'\n\t'#ad494a', // 'category20b-14'\n\t'#d6616b', // 'category20b-15'\n\t'#e7969c', // 'category20b-16'\n\t'#7b4173', // 'category20b-17'\n\t'#a55194', // 'category20b-18'\n\t'#ce6dbd', // 'category20b-19'\n\t'#de9ed6' // 'category20b-20'\n];\n\nCOLORS.category20c = [\n\t'#3182bd', // 'category20c-1'\n\t'#6baed6', // 'category20c-2'\n\t'#9ecae1', // 'category20c-3'\n\t'#c6dbef', // 'category20c-4'\n\t'#e6550d', // 'category20c-5'\n\t'#fd8d3c', // 'category20c-6'\n\t'#fdae6b', // 'category20c-7'\n\t'#fdd0a2', // 'category20c-8'\n\t'#31a354', // 'category20c-9'\n\t'#74c476', // 'category20c-10'\n\t'#a1d99b', // 'category20c-11'\n\t'#c7e9c0', // 'category20c-12'\n\t'#756bb1', // 'category20c-13'\n\t'#9e9ac8', // 'category20c-14'\n\t'#bcbddc', // 'category20c-15'\n\t'#dadaeb', // 'category20c-16'\n\t'#636363', // 'category20c-17'\n\t'#969696', // 'category20c-18'\n\t'#bdbdbd', // 'category20c-19'\n\t'#d9d9d9' // 'category20c-20'\n];\n\n\n// EXPORTS //\n\nexport default COLORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport format from '@stdlib/string/format';\nimport COLORS from './colors.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:colors' );\n\n\n// MAIN //\n\n/**\n* Sets the data colors.\n*\n* @private\n* @param {(string|StringArray)} v - data colors\n* @throws {TypeError} must be either a string or an array of strings\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isStr = isString( v );\n\tif ( !isStr && !isStringArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'colors', v ) );\n\t}\n\tif ( isStr ) {\n\t\tif ( COLORS[ v ] === void 0 ) {\n\t\t\tv = [ v ];\n\t\t} else {\n\t\t\tv = COLORS[ v ].slice();\n\t\t}\n\t} else {\n\t\tv = v.slice();\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._colors ) );\n\n\tthis._colors = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._colors ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport LINESTYLES from './line_styles.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:line-style' );\n\n\n// MAIN //\n\n/**\n* Sets the data line style(s).\n*\n* @private\n* @param {(string|StringArray)} v - line style(s)\n* @throws {TypeError} must be a string or string array\n* @throws {Error} must be a supported line style\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isStr = isString( v );\n\tvar i;\n\tif ( !isStr && !isStringArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'lineStyle', v ) );\n\t}\n\tif ( isStr ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( indexOf( LINESTYLES, v[i] ) === -1 ) {\n\t\t\tthrow new Error( format( 'invalid assignment. Unsupported/unrecognized line style. Must be one of the following: \"%s\". Value: `%s`.', LINESTYLES.join( '\", \"' ), v[i] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._lineStyle ) );\n\n\tthis._lineStyle = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._lineStyle ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math/base/assert/is-integer';\nimport MAX_LENGTH from '@stdlib/constants/array/max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is array-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is array-like\n*\n* @example\n* var bool = isArrayLike( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLike( { 'length': 10 } );\n* // returns true\n*/\nfunction isArrayLike( value ) {\n\treturn (\n\t\tvalue !== void 0 &&\n\t\tvalue !== null &&\n\t\ttypeof value !== 'function' &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLike from './../../../is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array-like object passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array-like object function\n*\n* @example\n* import isOdd from '@stdlib/assert/is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arraylikefcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arraylikefcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array-like object passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArrayLike( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arraylikefcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object of numbers.\n*\n* @module @stdlib/assert/is-number-array\n*\n* @example\n* import isNumberArray from '@stdlib/assert/is-number-array';\n*\n* var bool = isNumberArray( [ 1, 2, 3 ] );\n* // returns true\n*\n* bool = isNumberArray( [ '1', 2, 3 ] );\n* // returns false\n*\n* @example\n* import { primitives as isNumberArray } from '@stdlib/assert/is-number-array';\n*\n* var bool = isNumberArray( [ 1, 2, 3 ] );\n* // returns true\n*\n* bool = isNumberArray( [ 1, new Number( 2 ) ] );\n* // returns false\n*\n* @example\n* import { objects as isNumberArray } from '@stdlib/assert/is-number-array';\n*\n* var bool = isNumberArray( [ new Number( 1 ), new Number( 2 ) ] );\n* // returns true\n*\n* bool = isNumberArray( [ new Number( 1 ), 2 ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport arrayfun from './../../tools/array-like-function';\nimport isNumber from './../../is-number';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isNumber.isPrimitive );\nvar isObjectArray = arrayfun( isNumber.isObject );\n\n\n// MAIN //\n\nvar isNumberArray = arrayfun( isNumber );\nsetReadOnly( isNumberArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isNumberArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isNumberArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport { primitives as isNumberArray } from '@stdlib/assert/is-number-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:line-opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the data line opacity.\n*\n* @private\n* @param {(number|NumberArray)} v - opacity\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( v );\n\tvar i;\n\tif ( !isNum && !isNumberArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'lineOpacity', v ) );\n\t}\n\tif ( isNum ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( v[ i ] < 0.0 || v[ i ] > 1.0 ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'lineOpacity', v[i] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._lineOpacity ) );\n\n\tthis._lineOpacity = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._lineOpacity ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object containing only nonnegative integers.\n*\n* @module @stdlib/assert/is-nonnegative-integer-array\n*\n* @example\n* import isNonNegativeIntegerArray from '@stdlib/assert/is-nonnegative-integer-array';\n*\n* var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] );\n* // returns true\n*\n* bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] );\n* // returns false\n*\n* @example\n* import { primitives as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\n*\n* var bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );\n* // returns true\n*\n* bool = isNonNegativeIntegerArray( [ 3.0, new Number(1.0) ] );\n* // returns false\n*\n* @example\n* import { objects as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\n*\n* var bool = isNonNegativeIntegerArray( [ new Number(3.0), new Number(1.0) ] );\n* // returns true\n*\n* bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport isNonNegativeInteger from './../../is-nonnegative-integer';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport arrayfun from './../../tools/array-like-function';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isNonNegativeInteger.isPrimitive );\nvar isObjectArray = arrayfun( isNonNegativeInteger.isObject );\n\n\n// MAIN //\n\nvar isNonNegativeIntegerArray = arrayfun( isNonNegativeInteger );\nsetReadOnly( isNonNegativeIntegerArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isNonNegativeIntegerArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isNonNegativeIntegerArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport { primitives as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:line-width' );\n\n\n// MAIN //\n\n/**\n* Sets the data line width(s).\n*\n* @private\n* @param {(NonNegativeInteger|Array)} v - width\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isInt = isNonNegativeInteger( v );\n\tif ( !isInt && !isNonNegativeIntegerArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'lineWidth', v ) );\n\t}\n\tif ( isInt ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._lineWidth ) );\n\n\tthis._lineWidth = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._lineWidth ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport SYMBOLS from './symbols.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:symbols' );\n\n\n// MAIN //\n\n/**\n* Sets the data symbols.\n*\n* @private\n* @param {(string|StringArray)} v - data symbols\n* @throws {TypeError} must be a string or string array\n* @throws {Error} must be a supported symbol\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isStr = isString( v );\n\tvar i;\n\tif ( !isStr && !isStringArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'symbols', v ) );\n\t}\n\tif ( isStr ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( indexOf( SYMBOLS, v[i] ) === -1 ) {\n\t\t\tthrow new Error( format( 'invalid assignment. Unrecognized/unsupported symbol. Value: `[%s]`.', v.join(',') ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._symbols ) );\n\n\tthis._symbols = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._symbols ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport { primitives as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:symbols-size' );\n\n\n// MAIN //\n\n/**\n* Sets the symbols size.\n*\n* @private\n* @param {(NonNegativeInteger|Array)} v - size\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isInt = isNonNegativeInteger( v );\n\tif ( !isInt && !isNonNegativeIntegerArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'symbolsSize', v ) );\n\t}\n\tif ( isInt ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._symbolsSize ) );\n\n\tthis._symbolsSize = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._symbolsSize ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport { primitives as isNumberArray } from '@stdlib/assert/is-number-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:symbols-opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the symbol opacity.\n*\n* @private\n* @param {(number|NumberArray)} v - opacity\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @returns {void}\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( v );\n\tvar i;\n\tif ( !isNum && !isNumberArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'symbolsOpacity', v ) );\n\t}\n\tif ( isNum ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( v[ i ] < 0.0 || v[ i ] > 1.0 ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'symbolsOpacity', v[ i ] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._symbolsOpacity ) );\n\n\tthis._symbolsOpacity = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._symbolsOpacity ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from './../../is-number';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive value\n*\n* @example\n* var bool = isPositiveNumber( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveNumber( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveNumber( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from './../../is-number';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive value\n*\n* @example\n* var bool = isPositiveNumber( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveNumber( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveNumber( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a positive number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive number\n*\n* @example\n* var bool = isPositiveNumber( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveNumber( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isPositiveNumber( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveNumber( null );\n* // returns false\n*/\nfunction isPositiveNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive number.\n*\n* @module @stdlib/assert/is-positive-number\n*\n* @example\n* import isPositiveNumber from '@stdlib/assert/is-positive-number';\n*\n* var bool = isPositiveNumber( 5.0 );\n* // returns true\n*\n* bool = isPositiveNumber( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveNumber( 3.14 );\n* // returns true\n*\n* bool = isPositiveNumber( -5.0 );\n* // returns false\n*\n* bool = isPositiveNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\n*\n* var bool = isPositiveNumber( 3.0 );\n* // returns true\n*\n* bool = isPositiveNumber( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveNumber } from '@stdlib/assert/is-positive-number';\n*\n* var bool = isPositiveNumber( 3.0 );\n* // returns false\n*\n* bool = isPositiveNumber( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:width' );\n\n\n// MAIN //\n\n/**\n* Sets the width.\n*\n* @private\n* @param {PositiveNumber} width - width\n* @throws {TypeError} must be a positive number\n*/\nfunction set( width ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isPositiveNumber( width ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', width ) );\n\t}\n\tif ( width !== this._width ) {\n\t\tdebug( 'Current value: %d.', this._width );\n\n\t\tthis._width = width;\n\t\tdebug( 'New value: %d.', this._width );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:height' );\n\n\n// MAIN //\n\n/**\n* Sets the height.\n*\n* @private\n* @param {PositiveNumber} height - height\n* @throws {TypeError} must be a positive number\n* @returns {void}\n*/\nfunction set( height ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isPositiveNumber( height ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', height ) );\n\t}\n\tif ( height !== this._height ) {\n\t\tdebug( 'Current value: %d.', this._height );\n\n\t\tthis._height = height;\n\t\tdebug( 'New Value: %d.', this._height );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:padding-left' );\n\n\n// MAIN //\n\n/**\n* Sets the left padding.\n*\n* @private\n* @param {NonNegativeInteger} padding - padding\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( padding ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( padding ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingLeft', padding ) );\n\t}\n\tif ( padding !== this._paddingLeft ) {\n\t\tdebug( 'Current value: %d.', this._paddingLeft );\n\n\t\tthis._paddingLeft = padding;\n\t\tdebug( 'New value: %d.', this._paddingLeft );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:padding-right' );\n\n\n// MAIN //\n\n/**\n* Sets the right padding.\n*\n* @private\n* @param {NonNegativeInteger} padding - padding\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( padding ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( padding ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingRight', padding ) );\n\t}\n\tif ( padding !== this._paddingRight ) {\n\t\tdebug( 'Current value: %d.', this._paddingRight );\n\n\t\tthis._paddingRight = padding;\n\t\tdebug( 'New value: %d.', this._paddingRight );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:padding-top' );\n\n\n// MAIN //\n\n/**\n* Sets the top padding.\n*\n* @private\n* @param {NonNegativeInteger} padding - padding\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( padding ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( padding ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingTop', padding ) );\n\t}\n\tif ( padding !== this._paddingTop ) {\n\t\tdebug( 'Current value: %d.', this._paddingTop );\n\n\t\tthis._paddingTop = padding;\n\t\tdebug( 'New value: %d.', this._paddingTop );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:padding-bottom' );\n\n\n// MAIN //\n\n/**\n* Sets the bottom padding.\n*\n* @private\n* @param {NonNegativeInteger} padding - padding\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( padding ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( padding ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'paddingBottom', padding ) );\n\t}\n\tif ( padding !== this._paddingBottom ) {\n\t\tdebug( 'Current value: %d.', this._paddingBottom );\n\n\t\tthis._paddingBottom = padding;\n\t\tdebug( 'New value: %d.', this._paddingBottom );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `null`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is null\n*\n* @example\n* var bool = isNull( null );\n* // returns true\n*\n* bool = isNull( true );\n* // returns false\n*/\nfunction isNull( value ) {\n\treturn value === null;\n}\n\n\n// EXPORTS //\n\nexport default isNull;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-min' );\n\n\n// MAIN //\n\n/**\n* Sets the minimum value of the x-axis domain.\n*\n* @private\n* @param {(Date|FiniteNumber|null)} min - minimum value\n* @throws {TypeError} must be a finite number or null\n* @returns {void}\n*/\nfunction set( min ) {\n\t/* eslint-disable no-invalid-this */\n\n\t// TODO: add test to determine if evaluates to valid date?\n\tif (\n\t\t!isNull( min ) &&\n\t\t!isNumber( min ) // FIXME: finite number\n\n\t\t// TODO: Date\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a finite number, Date, or null. Value: `%s`.', 'xMin', min ) );\n\t}\n\tdebug( 'Current value: %s.', this._xMin );\n\n\tthis._xMin = min;\n\tdebug( 'New value: %s.', this._xMin );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Computes a minimum value.\n*\n* @private\n* @param {NumericArray} arr - input array\n* @returns {(number|null)} minimum value or null\n*/\nfunction getMin( arr ) {\n\tvar min;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\tmin = arr[ 0 ];\n\tfor ( i = 1; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] < min ) {\n\t\t\tmin = arr[ i ];\n\t\t}\n\t}\n\treturn min;\n}\n\n\n// EXPORTS //\n\nexport default getMin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'line:set:x-max' );\n\n\n// MAIN //\n\n/**\n* Sets the maximum value of the x-axis domain.\n*\n* @private\n* @param {(Date|FiniteNumber|null)} max - maximum value\n* @throws {TypeError} must be a finite number primitive or null\n*/\nfunction set( max ) {\n\t/* eslint-disable no-invalid-this */\n\n\t// TODO: add test to determine if evaluates to valid date?\n\tif (\n\t\t!isNull( max ) &&\n\t\t!isNumber( max ) // FIXME: finite number\n\n\t\t// TODO: Date\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a finite number, Date, or null. Value: `%s`.', 'xMax', max ) );\n\t}\n\tif ( max !== this._xMax ) {\n\t\tdebug( 'Current value: %s.', this._xMax );\n\n\t\tthis._xMax = max;\n\t\tdebug( 'New value: %s.', this._xMax );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Computes a maximum value.\n*\n* @private\n* @param {NumericArray} arr - input array\n* @returns {(number|null)} maximum value or null\n*/\nfunction getMax( arr ) {\n\tvar max;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\tmax = arr[ 0 ];\n\tfor ( i = 1; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] > max ) {\n\t\t\tmax = arr[ i ];\n\t\t}\n\t}\n\treturn max;\n}\n\n\n// EXPORTS //\n\nexport default getMax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-min' );\n\n\n// MAIN //\n\n/**\n* Sets the minimum value of the y-axis domain.\n*\n* @private\n* @param {(FiniteNumber|null)} min - minimum value\n* @throws {TypeError} must be a finite number or null\n* @returns {void}\n*/\nfunction set( min ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isNull( min ) &&\n\t\t!isNumber( min ) // FIXME: finite number\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or null. Value: `%s`.', 'yMin', min ) );\n\t}\n\tif ( min !== this._yMin ) {\n\t\tdebug( 'Current value: %d.', this._yMin );\n\n\t\tthis._yMin = min;\n\t\tdebug( 'New value: %d.', this._yMin );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-max' );\n\n\n// MAIN //\n\n/**\n* Sets the maximum value of the y-axis domain.\n*\n* @private\n* @param {(FiniteNumber|null)} max - maximum value\n* @throws {TypeError} must be a finite number or null\n* @returns {void}\n*/\nfunction set( max ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isNull( max ) &&\n\t\t!isNumber( max ) // FIXME: finite number\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or null. Value: `%s`.', 'yMax', max ) );\n\t}\n\tif ( max !== this._yMax ) {\n\t\tdebug( 'Current value: %d.', this._yMax );\n\n\t\tthis._yMax = max;\n\t\tdebug( 'New value: %d.', this._yMax );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-scale' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis scale.\n*\n* @private\n* @param {string} scale - axis scale\n* @throws {TypeError} must be a string\n* @returns {void}\n*/\nfunction set( scale ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( scale ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'xScale', scale ) );\n\t}\n\t// TODO: test for valid scale\n\n\tif ( scale !== this._xScale ) {\n\t\tdebug( 'Current value: %s.', this._xScale );\n\n\t\tthis._xScale = scale;\n\t\tdebug( 'New value: %s.', this._xScale );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {deg2rad, rad2deg} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": formatDecimal,\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval.js\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval.js\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","import interval from \"./interval.js\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval.js\";\nimport {durationMinute} from \"./duration.js\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","import interval from \"./interval.js\";\nimport {durationHour} from \"./duration.js\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval.js\";\nimport {durationDay} from \"./duration.js\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval.js\";\nimport {durationWeek} from \"./duration.js\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval.js\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval.js\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {utcFormat} from \"./defaultLocale.js\";\n\nexport var isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : utcFormat(isoSpecifier);\n\nexport default formatIso;\n","import {isoSpecifier} from \"./isoFormat.js\";\nimport {utcParse} from \"./defaultLocale.js\";\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : utcParse(isoSpecifier);\n\nexport default parseIso;\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","export default function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return \"#\" + x;\n });\n}\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"./colors\";\n\nexport default colors(\"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6\");\n","import colors from \"./colors\";\n\nexport default colors(\"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9\");\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5\");\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar rainbow = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + \"\";\n}\n","import colors from \"./colors\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {calendar} from \"./time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcMillisecond} from \"d3-time\";\n\nexport default function() {\n return calendar(utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcMillisecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]);\n}\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nvar time = require( 'd3-scale' ).scaleTime; // TODO: remove\n\n\n// MAIN //\n\n/**\n* Returns a scale function for mapping values to a coordinate along the x-axis.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale;\n\tif ( this._xScale === 'time' ) {\n\t\tscale = time()\n\t\t\t.domain( this.xDomain )\n\t\t\t.range( this.xRange );\n\t} else if ( this._xScale === 'linear' ) {\n\t\tscale = linear()\n\t\t\t.domain( this.xDomain )\n\t\t\t.range( this.xRange );\n\t}\n\t// TODO: other scales\n\treturn scale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-scale' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis scale.\n*\n* @private\n* @param {string} scale - axis scale\n* @throws {TypeError} must be a string\n* @returns {void}\n*/\nfunction set( scale ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( scale ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'yScale', scale ) );\n\t}\n\t// TODO: test for valid scale\n\n\tdebug( 'Current value: %s.', this._yScale );\n\n\tthis._yScale = scale;\n\tdebug( 'New value: %s.', this._yScale );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nvar time = require( 'd3-scale' ).scaleTime; // TODO: remove\n\n\n// MAIN //\n\n/**\n* Returns a scale function for mapping values to a coordinate along the y-axis.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale;\n\tif ( this._yScale === 'time' ) {\n\t\tscale = time()\n\t\t\t.domain( this.yDomain )\n\t\t\t.range( this.yRange );\n\t} else if ( this._yScale === 'linear' ) {\n\t\tscale = linear()\n\t\t\t.domain( this.yDomain )\n\t\t\t.range( this.yRange );\n\t}\n\t// TODO: other scales\n\treturn scale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-tick-format' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis tick format.\n*\n* @private\n* @param {(string|null)} fmt - axis tick format\n* @throws {TypeError} must be a string\n*/\nfunction set( fmt ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNull( fmt ) && !isString( fmt ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or null. Value: `%s`.', 'xTickFormat', fmt ) );\n\t}\n\tif ( fmt !== this._xTickFormat ) {\n\t\tdebug( 'Current value: %s.', this._xTickFormat );\n\n\t\tthis._xTickFormat = fmt;\n\t\tdebug( 'New value: %s.', this._xTickFormat );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( 'd3-format' ).format; // TODO: remove\nvar timeFormat = require( 'd3-time-format' ).timeFormat; // TODO: remove\nimport isNull from '@stdlib/assert/is-null';\n\n\n// MAIN //\n\n/**\n* Returns the x-axis tick format.\n*\n* @private\n* @returns {(Function|null)} format function or null\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tif ( isNull( this._xTickFormat ) ) {\n\t\treturn this._xTickFormat;\n\t}\n\tif ( this._xScale === 'time' ) {\n\t\treturn timeFormat( this._xTickFormat );\n\t}\n\treturn format( this._xTickFormat );\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-tick-format' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis tick format.\n*\n* @private\n* @param {(string|null)} fmt - axis tick format\n* @throws {TypeError} must be a string or null\n*/\nfunction set( fmt ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNull( fmt ) && !isString( fmt ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or null. Value: `%s`.', 'yTickFormat', fmt ) );\n\t}\n\tif ( fmt !== this._yTickFormat ) {\n\t\tdebug( 'Current value: %s.', this._yTickFormat );\n\n\t\tthis._yTickFormat = fmt;\n\t\tdebug( 'New value: %s.', this._yTickFormat );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( 'd3-format' ).format; // TODO: remove\nvar timeFormat = require( 'd3-time-format' ).timeFormat; // TODO: remove\nimport isNull from '@stdlib/assert/is-null';\n\n\n// MAIN //\n\n/**\n* Returns the y-axis tick format.\n*\n* @private\n* @returns {(Function|null)} format function or null\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tif ( isNull( this._yTickFormat ) ) {\n\t\treturn this._yTickFormat;\n\t}\n\tif ( this._yScale === 'time' ) {\n\t\treturn timeFormat( this._yTickFormat );\n\t}\n\treturn format( this._yTickFormat );\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-num-ticks' );\n\n\n// MAIN //\n\n/**\n* Sets the number of x-axis tick marks.\n*\n* @private\n* @param {(NonNegativeInteger|null)} ticks - number of ticks\n* @throws {TypeError} must be a nonnegative integer or null\n*/\nfunction set( ticks ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNull( ticks ) && !isNonNegativeInteger( ticks ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'xNumTicks', ticks ) );\n\t}\n\tif ( ticks !== this._xNumTicks ) {\n\t\tdebug( 'Current value: %d.', this._xNumTicks );\n\n\t\tthis._xNumTicks = ticks;\n\t\tdebug( 'New value: %d.', this._xNumTicks );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-num-ticks' );\n\n\n// MAIN //\n\n/**\n* Sets the number of y-axis tick marks.\n*\n* @private\n* @param {(NonNegativeInteger|null)} ticks - number of ticks\n* @throws {TypeError} must be a nonnegative integer or null\n*/\nfunction set( ticks ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNull( ticks ) && !isNonNegativeInteger( ticks ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'yNumTicks', ticks ) );\n\t}\n\tif ( ticks !== this._yNumTicks ) {\n\t\tdebug( 'Current value: %d.', this._yNumTicks );\n\n\t\tthis._yNumTicks = ticks;\n\t\tdebug( 'New value: %d.', this._yNumTicks );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './orientations.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-axis-orient' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis orientation.\n*\n* @private\n* @param {string} orientation - axis orientation\n* @throws {TypeError} must be either `'bottom'` or `'top'`\n*/\nfunction set( orientation ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( ORIENTATIONS, orientation ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be one of the following: \"%s\". Value: `%s`.', 'xAxisOrient', ORIENTATIONS.join( '\", \"' ), orientation ) );\n\t}\n\tif ( orientation !== this._xAxisOrient ) {\n\t\tdebug( 'Current value: %s.', this._xAxisOrient );\n\n\t\tthis._xAxisOrient = orientation;\n\t\tdebug( 'New value: %s.', this._xAxisOrient );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './orientations.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-axis-orient' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis orientation.\n*\n* @private\n* @param {string} orientation - axis orientation\n* @throws {TypeError} must be either `'left'` or `'right'`\n*/\nfunction set( orientation ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( ORIENTATIONS, orientation ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be one of the following: \"%s\". Value: `%s`.', 'yAxisOrient', ORIENTATIONS.join( '\", \"' ), orientation ) );\n\t}\n\tif ( orientation !== this._yAxisOrient ) {\n\t\tdebug( 'Current value: %s.', this._yAxisOrient );\n\n\t\tthis._yAxisOrient = orientation;\n\t\tdebug( 'New value: %s.', this._yAxisOrient );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object of booleans.\n*\n* @module @stdlib/assert/is-boolean-array\n*\n* @example\n* import isBooleanArray from '@stdlib/assert/is-boolean-array';\n*\n* var bool = isBooleanArray( [ true, false, true ] );\n* // returns true\n*\n* bool = isBooleanArray( [ true, 'abc', false ] );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n* import { primitives as isBooleanArray } from '@stdlib/assert/is-boolean-array';\n*\n* var bool = isBooleanArray( [ true, false ] );\n* // returns true\n*\n* bool = isBooleanArray( [ false, new Boolean( true ) ] );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean/ctor';\n* import { objects as isBooleanArray } from '@stdlib/assert/is-boolean-array';\n*\n* var bool = isBooleanArray( [ new Boolean( false ), new Boolean( true ) ] );\n* // returns true\n*\n* bool = isBooleanArray( [ new Boolean( false ), true ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport arrayfun from './../../tools/array-like-function';\nimport isBoolean from './../../is-boolean';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isBoolean.isPrimitive );\nvar isObjectArray = arrayfun( isBoolean.isObject );\n\n\n// MAIN //\n\nvar isBooleanArray = arrayfun( isBoolean );\nsetReadOnly( isBooleanArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isBooleanArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport { primitives as isBooleanArray } from '@stdlib/assert/is-boolean-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-rug' );\n\n\n// MAIN //\n\n/**\n* Sets a flag indicating whether to display a rug plot along the x-axis.\n*\n* @private\n* @param {(boolean|BooleanArray)} v - boolean flag(s) indicating whether to display a rug plot along the x-axis\n* @throws {TypeError} must be a boolean or boolean array\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isBool = isBoolean( v );\n\tif ( !isBool && !isBooleanArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean or an array of booleans. Value: `%s`.', 'xRug', v ) );\n\t}\n\tif ( isBool ) {\n\t\tv = [ v ];\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xRug ) );\n\n\tthis._xRug = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._xRug ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport { primitives as isBooleanArray } from '@stdlib/assert/is-boolean-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-rug' );\n\n\n// MAIN //\n\n/**\n* Sets a flag indicating whether to display a rug plot along the y-axis.\n*\n* @private\n* @param {(boolean|BooleanArray)} v - boolean flag(s) indicating whether to display a rug plot along the y-axis\n* @throws {TypeError} must be a boolean or boolean array\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isBool = isBoolean( v );\n\tif ( !isBool && !isBooleanArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean or an array of booleans. Value: `%s`.', 'yRug', v ) );\n\t}\n\tif ( isBool ) {\n\t\tv = [ v ];\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yRug ) );\n\n\tthis._yRug = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._yRug ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './orientations.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-rug-orient' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis rug orientation.\n*\n* @private\n* @param {(string|StringArray)} v - rug orientation\n* @throws {TypeError} must be either a string or string array\n* @throws {TypeError} must be either `'bottom'` or `'top'`\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isStr = isString( v );\n\tvar i;\n\tif ( !isStr && !isStringArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'xRugOrient', v ) );\n\t}\n\tif ( isStr ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( indexOf( ORIENTATIONS, v[i] ) === -1 ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Unrecognized/unsupported orientation. A `%s` value must be one of the following: \"%s\". Value: `%s`.', 'xRugOrient', ORIENTATIONS.join( '\", \"' ), v[ i ] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xRugOrient ) );\n\n\tthis._xRugOrient = v;\n\tdebug( 'New value: %s.', JSON.stringify( this._xRugOrient ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport { primitives as isStringArray } from '@stdlib/assert/is-string-array';\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './orientations.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-rug-orient' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis rug orientation.\n*\n* @private\n* @param {(string|StringArray)} v - rug orientation\n* @throws {TypeError} must be either a string or string array\n* @throws {TypeError} must be either `'bottom'` or `'top'`\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isStr = isString( v );\n\tvar i;\n\tif ( !isStr && !isStringArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', 'yRugOrient', v ) );\n\t}\n\tif ( isStr ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( indexOf( ORIENTATIONS, v[i] ) === -1 ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Unrecognized/unsupported orientation. A `%s` value must be one of the following: \"%s\". Value: `%s`.', 'yRugOrient', ORIENTATIONS.join( '\", \"' ), v[i] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yRugOrient ) );\n\n\tthis._yRugOrient = v;\n\tdebug( 'New value: %s.', JSON.stringify( this._yRugOrient ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport { primitives as isNumberArray } from '@stdlib/assert/is-number-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-rug-opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis rug opacity.\n*\n* @private\n* @param {(number|NumberArray)} v - opacity\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( v );\n\tvar i;\n\tif ( !isNum && !isNumberArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'xRugOpacity', v ) );\n\t}\n\tif ( isNum ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( v[ i ] < 0.0 || v[ i ] > 1.0 ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'xRugOpacity', v[i] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xRugOpacity ) );\n\n\tthis._xRugOpacity = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._xRugOpacity ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport { primitives as isNumberArray } from '@stdlib/assert/is-number-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-rug-opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis rug opacity.\n*\n* @private\n* @param {(number|NumberArray)} v - opacity\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( v );\n\tvar i;\n\tif ( !isNum && !isNumberArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or an array of numbers. Value: `%s`.', 'yRugOpacity', v ) );\n\t}\n\tif ( isNum ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tfor ( i = 0; i < v.length; i++ ) {\n\t\tif ( v[ i ] < 0.0 || v[ i ] > 1.0 ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. A `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'yRugOpacity', v[ i ] ) );\n\t\t}\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yRugOpacity ) );\n\n\tthis._yRugOpacity = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._yRugOpacity ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport { primitives as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-rug-size' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis rug tick (tassel) size.\n*\n* @private\n* @param {(NonNegativeInteger|Array)} v - size\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isInt = isNonNegativeInteger( v );\n\tif ( !isInt && !isNonNegativeIntegerArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'xRugSize', v ) );\n\t}\n\tif ( isInt ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xRugSize ) );\n\n\tthis._xRugSize = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._xRugSize ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport { primitives as isNonNegativeIntegerArray } from '@stdlib/assert/is-nonnegative-integer-array';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-rug-size' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis rug tick (tassel) size.\n*\n* @private\n* @param {(NonNegativeInteger|Array)} v - size\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isInt = isNonNegativeInteger( v );\n\tif ( !isInt && !isNonNegativeIntegerArray( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or an array of nonnegative integers. Value: `%s`.', 'yRugSize', v ) );\n\t}\n\tif ( isInt ) {\n\t\tv = [ v ];\n\t} else {\n\t\tv = v.slice();\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yRugSize ) );\n\n\tthis._yRugSize = v;\n\tdebug( 'New Value: %s.', JSON.stringify( this._yRugSize ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:description' );\n\n\n// MAIN //\n\n/**\n* Sets the description.\n*\n* @private\n* @param {string} str - description\n* @throws {TypeError} must be a string\n*/\nfunction set( str ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'description', str ) );\n\t}\n\tif ( str !== this._description ) {\n\t\tdebug( 'Current value: %s.', this._description );\n\n\t\tthis._description = str;\n\t\tdebug( 'New value: %s.', this._description );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:title' );\n\n\n// MAIN //\n\n/**\n* Sets the title.\n*\n* @private\n* @param {string} str - title\n* @throws {TypeError} must be a string\n*/\nfunction set( str ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'title', str ) );\n\t}\n\tif ( str !== this._title ) {\n\t\tdebug( 'Current value: %s.', this._title );\n\n\t\tthis._title = str;\n\t\tdebug( 'New value: %s.', this._title );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:x-label' );\n\n\n// MAIN //\n\n/**\n* Sets the x-axis label.\n*\n* @private\n* @param {string} label - axis label\n* @throws {TypeError} must be a string\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( label ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'xLabel', label ) );\n\t}\n\tif ( label !== this._xLabel ) {\n\t\tdebug( 'Current value: %s.', this._xLabel );\n\n\t\tthis._xLabel = label;\n\t\tdebug( 'New value: %s.', this._xLabel );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:y-label' );\n\n\n// MAIN //\n\n/**\n* Sets the y-axis label.\n*\n* @private\n* @param {string} label - axis label\n* @throws {TypeError} must be a string\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( label ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'yLabel', label ) );\n\t}\n\tif ( label !== this._yLabel ) {\n\t\tdebug( 'Current value: %s.', this._yLabel );\n\n\t\tthis._yLabel = label;\n\t\tdebug( 'New value: %s.', this._yLabel );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar C64_BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\nvar C128_BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplexTypedArray( [] );\n* // returns false\n*/\nfunction isComplexTypedArray( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex-typed-array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\t\t\tvalue.BYTES_PER_ELEMENT === C128_BYTES_PER_ELEMENT\n\t\t\t) ||\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\t\t\tvalue.BYTES_PER_ELEMENT === C64_BYTES_PER_ELEMENT\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 1; // 1 bytes per uint8\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*\n* @example\n* import BooleanArray from '@stdlib/array/bool';\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* bool = isBooleanArray( [] );\n* // returns false\n*/\nfunction isBooleanArray( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `BooleanArray` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-booleanarray`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if two double-precision floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {number} a - first input value\n* @param {number} b - second input value\n* @returns {boolean} boolean indicating whether two double-precision floating-point numbers are the same value\n*\n* @example\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* @example\n* var bool = isSameValue( NaN, NaN );\n* // returns true\n*/\nfunction isSameValue( a, b ) {\n\tif ( a === b ) {\n\t\tif ( a === 0.0 ) {\n\t\t\treturn 1.0 / a === 1.0 / b; // handles +-0\n\t\t}\n\t\treturn true;\n\t}\n\treturn ( a !== a && b !== b ); // handles NaNs\n}\n\n\n// EXPORTS //\n\nexport default isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array/float64';\n\n\n// MAIN //\n\n/**\n* Returns the real and imaginary components of a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {Float64Array} real and imaginary components\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = reim( z );\n* // returns [ 5.0, 3.0 ]\n*/\nfunction reim( z ) {\n\tvar out = new Float64Array( 2 );\n\tout[ 0 ] = z.re;\n\tout[ 1 ] = z.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default reim;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSameComplexValue from '@stdlib/complex/float64/base/assert/is-same-value';\nimport isComplexLike from './../../is-complex-like';\n\n\n// MAIN //\n\n/**\n* Tests if two arguments are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] (as specified in ECMAScript 5), with support for complex number objects.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {*} a - first input value\n* @param {*} b - second input value\n* @returns {boolean} boolean indicating whether two arguments are the same value\n*\n* @example\n* var bool = isSameValue( true, true );\n* // returns true\n*\n* @example\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( {}, {} );\n* // returns false\n*\n* @example\n* var bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* @example\n* var bool = isSameValue( NaN, NaN );\n* // returns true\n*\n* @example\n* var bool = isSameValue( [], [] );\n* // returns false\n*/\nfunction isSameValue( a, b ) {\n\tif ( a === b ) {\n\t\tif ( a === 0.0 ) {\n\t\t\treturn 1.0 / a === 1.0 / b; // handles +-0\n\t\t}\n\t\treturn true;\n\t}\n\tif ( a !== a && b !== b ) { // handles NaNs\n\t\treturn true;\n\t}\n\tif ( isComplexLike( a ) && isComplexLike( b ) ) {\n\t\treturn isSameComplexValue( a, b );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSame from '@stdlib/number/float64/base/assert/is-same-value';\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isSameValue( z1, z2 );\n* // returns true\n*/\nfunction isSameValue( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/assert/is-accessor-array';\nimport isComplexLike from '@stdlib/assert/is-complex-like';\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport reinterpret from '@stdlib/strided/base/reinterpret-complex';\nimport reinterpretBoolean from '@stdlib/strided/base/reinterpret-boolean';\nimport isComplexTypedArray from './../../../base/assert/is-complex-typed-array';\nimport isBooleanArray from './../../../base/assert/is-booleanarray';\nimport resolveGetter from './../../../base/resolve-getter';\nimport isSameValue from '@stdlib/assert/is-same-value';\nimport real from '@stdlib/complex/float64/real';\nimport imag from '@stdlib/complex/float64/imag';\n\n\n// FUNCTIONS //\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexed( x, 2, 0 );\n* // returns 1\n*/\nfunction indexed( x, searchElement, fromIndex ) {\n\tvar i;\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( isSameValue( searchElement, x[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array object\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* import toAccessorArray from '@stdlib/array/base/to-accessor-array';\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n*\n* var idx = accessors( x, 2, 0 );\n* // returns 1\n*/\nfunction accessors( x, searchElement, fromIndex ) {\n\tvar get;\n\tvar i;\n\n\tget = resolveGetter( x );\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( isSameValue( searchElement, get( x, i ) ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var x = new Complex128Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] );\n*\n* var idx = complex( x, new Complex128( 3.0, 4.0 ), 1 );\n* // returns 2\n*/\nfunction complex( x, searchElement, fromIndex ) {\n\tvar view;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexLike( searchElement ) ) {\n\t\treturn -1;\n\t}\n\tview = reinterpret( x, 0 );\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tfor ( i = fromIndex*2; i < view.length; i += 2 ) {\n\t\tif ( isSameValue( view[ i ], re ) && isSameValue( view[ i+1 ], im ) ) {\n\t\t\treturn i / 2;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* import BooleanArray from '@stdlib/array/bool';\n*\n* var x = new BooleanArray( [ true, false, true, false, true ] );\n*\n* var idx = boolean( x, true, 1 );\n* // returns 2\n*/\nfunction boolean( x, searchElement, fromIndex ) {\n\tvar view;\n\tvar v;\n\tvar i;\n\tif ( !isBoolean( searchElement ) ) {\n\t\treturn -1;\n\t}\n\tview = reinterpretBoolean( x, 0 );\n\tv = ( searchElement ) ? 1 : 0;\n\tfor ( i = fromIndex; i < view.length; i++ ) {\n\t\tif ( view[ i ] === v ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// MAIN //\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* ## Notes\n*\n* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n* - If unable to find an element which equals a provided search element, the function returns `-1`.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {integer} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexOfSameValue( x, 2, 0 );\n* // returns 1\n*\n* @example\n* import Int32Array from '@stdlib/array/int32';\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var idx = indexOfSameValue( x, 2, 0 );\n* // returns 1\n*/\nfunction indexOfSameValue( x, searchElement, fromIndex ) {\n\tif ( fromIndex < 0 ) {\n\t\tfromIndex += x.length;\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex = 0;\n\t\t}\n\t}\n\tif ( isAccessorArray( x ) ) {\n\t\tif ( isComplexTypedArray( x ) ) {\n\t\t\treturn complex( x, searchElement, fromIndex );\n\t\t}\n\t\tif ( isBooleanArray( x ) ) {\n\t\t\treturn boolean( x, searchElement, fromIndex );\n\t\t}\n\t\treturn accessors( x, searchElement, fromIndex );\n\t}\n\treturn indexed( x, searchElement, fromIndex );\n}\n\n\n// EXPORTS //\n\nexport default indexOfSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from './../../../base/assert/is-accessor-array';\nimport accessorGetter from './../../../base/accessor-getter';\nimport getter from './../../../base/getter';\nimport dtype from './../../../dtype';\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nexport default resolveGetter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplex128Array from '@stdlib/array/base/assert/is-complex128array';\nimport isComplex64Array from '@stdlib/array/base/assert/is-complex64array';\nimport reinterpret128 from './../../../base/reinterpret-complex128';\nimport reinterpret64 from './../../../base/reinterpret-complex64';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* import Complex64Array from '@stdlib/array/complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from './../../is-collection';\nimport isFunction from './../../is-function';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object supporting the accessor (get/set) protocol.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array/complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*\n* @example\n* var bool = isAccessorArray( {} );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn (\n\t\tisCollection( value ) &&\n\t\tisFunction( value.get ) &&\n\t\tisFunction( value.set )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport contains from '@stdlib/assert/contains';\nimport format from '@stdlib/string/format';\nimport ENGINES from './engines.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:engine' );\n\n\n// MAIN //\n\n/**\n* Sets the engine.\n*\n* @private\n* @param {string} engine - engine\n* @throws {TypeError} must be a recognized engine\n*/\nfunction set( engine ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !contains( ENGINES, engine ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be one of the following: \"%s\". Value: `%s`.', 'engine', ENGINES.join( '\", \"' ), engine ) );\n\t}\n\tif ( engine !== this._engine ) {\n\t\tdebug( 'Current value: %s.', this._engine );\n\n\t\tthis._engine = engine;\n\t\tdebug( 'New value: %s.', this._engine );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:auto-render' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a boolean\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isBoolean( bool ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) );\n\t}\n\tif ( bool !== this._autoRender ) {\n\t\tdebug( 'Current value: %s.', this._autoRender );\n\n\t\tthis._autoRender = bool;\n\t\tdebug( 'New Value: %s.', this._autoRender );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport FORMATS from './formats.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:renderformat' );\n\n\n// MAIN //\n\n/**\n* Sets the render format.\n*\n* @private\n* @param {string} fmt - format\n* @throws {TypeError} must be a recognized render format\n*/\nfunction set( fmt ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( FORMATS, fmt ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. Unrecognized/unsupported `%s`. Must be one of the following: \"%s\". Value: `%s`.', 'format', FORMATS.join( '\", \"' ), fmt ) );\n\t}\n\tif ( fmt !== this._renderFormat ) {\n\t\tdebug( 'Current value: %s.', this._renderFormat );\n\n\t\tthis._renderFormat = fmt;\n\t\tdebug( 'New value: %s.', this._renderFormat );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport VIEWERS from './viewers.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:viewer' );\n\n\n// MAIN //\n\n/**\n* Sets the viewer.\n*\n* @private\n* @param {string} viewer - viewer\n* @throws {TypeError} must be a recognized viewer\n*/\nfunction set( viewer ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( VIEWERS, viewer ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. Unrecognized/unsupported `%s`. Value: `%s`.', 'viewer', viewer ) );\n\t}\n\tif ( viewer !== this._viewer ) {\n\t\tdebug( 'Current value: %s.', this._viewer );\n\n\t\tthis._viewer = viewer;\n\t\tdebug( 'New value: %s.', this._viewer );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:set:auto-view' );\n\n\n// MAIN //\n\n/**\n* Sets the viewing mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to generate an updated view on a render event\n* @throws {TypeError} must be a boolean\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isBoolean( bool ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoView', bool ) );\n\t}\n\tif ( bool !== this._autoView ) {\n\t\tdebug( 'Current value: %s.', this._autoView );\n\n\t\tthis._autoView = bool;\n\t\tdebug( 'New Value: %s.', this._autoView );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:x-pos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to x-axis coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.xScale;\n\treturn xPos;\n\n\t/**\n\t* Maps a value to a x-axis coordinate value.\n\t*\n\t* @private\n\t* @param {number} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction xPos( d ) {\n\t\tvar px = scale( d );\n\t\tdebug( 'Value: %d => Pixel: %d.', d, px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:y-pos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to y-axis coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.yScale;\n\treturn yPos;\n\n\t/**\n\t* Maps a value to a y-axis coordinate value.\n\t*\n\t* @private\n\t* @param {number} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction yPos( d ) {\n\t\tvar px = scale( d );\n\t\tdebug( 'Value: %d => Pixel: %d.', d, px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:marks:lines' );\n\n\n// MAIN //\n\n/**\n* Renders line marks.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar nOpacities;\n\tvar lineStyle;\n\tvar opacity;\n\tvar nColors;\n\tvar nStyles;\n\tvar nWidths;\n\tvar color;\n\tvar width;\n\tvar marks;\n\tvar line;\n\tvar len;\n\tvar i;\n\n\tline = state.$.svg.path;\n\tnOpacities = state.lineOpacity.length;\n\tnStyles = state.lineStyle.length;\n\tnWidths = state.lineWidth.length;\n\tnColors = state.colors.length;\n\n\tlen = state.x.length;\n\tmarks = [];\n\n\tdebug( 'Rendering lines...' );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tlineStyle = state.lineStyle[ i%nStyles ];\n\t\tdebug( 'Line style: %s (%d).', lineStyle, i );\n\n\t\tif ( lineStyle === 'none' ) {\n\t\t\tdebug( 'Line style (%d) is `none`. Skipping...', i );\n\t\t\tcontinue;\n\t\t}\n\t\tcolor = state.colors[ i%nColors ];\n\t\tdebug( 'Line color: %s (%d).', color, i );\n\n\t\topacity = state.lineOpacity[ i%nOpacities ];\n\t\tdebug( 'Line opacity: %s (%d).', opacity, i );\n\n\t\twidth = state.lineWidth[ i%nWidths ];\n\t\tdebug( 'Line width: %s (%d).', width, i );\n\n\t\tline.x = state.x[ i ];\n\t\tline.y = state.y[ i ];\n\t\tline.style = lineStyle;\n\t\tline.label = state.labels[ i ] || '';\n\t\tline.color = color;\n\t\tline.opacity = opacity;\n\t\tline.width = width;\n\n\t\tdebug( 'Rendering line %d...', i );\n\t\tmarks.push( line.render() );\n\t}\n\tdebug( 'Finished rendering lines.' );\n\treturn marks;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:marks:symbols' );\n\n\n// MAIN //\n\n/**\n* Renders symbols marks.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar nOpacities;\n\tvar nSymbols;\n\tvar nColors;\n\tvar opacity;\n\tvar nSizes;\n\tvar symbol;\n\tvar color;\n\tvar marks;\n\tvar size;\n\tvar sym;\n\tvar len;\n\tvar i;\n\n\tsym = state.$.svg.symbols;\n\tnOpacities = state.symbolsOpacity.length;\n\tnSymbols = state.symbols.length;\n\tnColors = state.colors.length;\n\tnSizes = state.symbolsSize.length;\n\n\tlen = state.x.length;\n\tmarks = [];\n\n\tdebug( 'Rendering symbols...' );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsymbol = state.symbols[ i%nSymbols ];\n\t\tdebug( 'Symbol: %s (%d).', symbol, i );\n\n\t\tif ( symbol === 'none' ) {\n\t\t\tdebug( 'Symbol (%d) is `none`. Skipping...', i );\n\t\t\tcontinue;\n\t\t}\n\t\topacity = state.symbolsOpacity[ i%nOpacities ];\n\t\tdebug( 'Symbols opacity: %d (%d).', opacity, i );\n\n\t\tsize = state.symbolsSize[ i%nSizes ];\n\t\tdebug( 'Symbols size: %d (%d).', size, i );\n\n\t\tcolor = state.colors[ i%nColors ];\n\t\tdebug( 'Symbols color: %s (%d).', color, i );\n\n\t\tsym.x = state.x[ i ];\n\t\tsym.y = state.y[ i ];\n\t\tsym.symbol = symbol;\n\t\tsym.label = state.labels[ i ] || '';\n\t\tsym.color = color;\n\t\tsym.size = size;\n\t\tsym.opacity = opacity;\n\n\t\tdebug( 'Rendering symbols %d...', i );\n\t\tmarks.push( sym.render() );\n\t}\n\tdebug( 'Finished rendering symbols.' );\n\treturn marks;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns an x-axis rug translation transform.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {number} height - graph height\n* @returns {string} transform\n*/\nfunction xRugTransform( orient, height ) {\n\tif ( orient === 'top' ) {\n\t\treturn 'translate(0,0)';\n\t}\n\treturn 'translate(0,'+height+')';\n}\n\n\n// EXPORTS //\n\nexport default xRugTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport xRugTransform from './../utils/x_rug_transform.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:marks:x-rug' );\n\n\n// MAIN //\n\n/**\n* Renders x-axis rug plots.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar rugTransform;\n\tvar nOpacities;\n\tvar nOrients;\n\tvar opacity;\n\tvar nColors;\n\tvar nSizes;\n\tvar orient;\n\tvar nFlgs;\n\tvar color;\n\tvar marks;\n\tvar size;\n\tvar rug;\n\tvar len;\n\tvar tmp;\n\tvar i;\n\n\trug = state.$.svg.xRug;\n\n\tnOpacities = state.xRugOpacity.length;\n\tnOrients = state.xRugOrient.length;\n\tnColors = state.colors.length;\n\tnSizes = state.xRugSize.length;\n\tnFlgs = state.xRug.length;\n\n\tlen = state.x.length;\n\tmarks = [];\n\n\tdebug( 'Rendering x-axis rug plots...' );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( !state.xRug[ i%nFlgs ] ) {\n\t\t\tdebug( 'Rug plot (%d) disabled. Skipping...', i );\n\t\t\tcontinue;\n\t\t}\n\t\tcolor = state.colors[ i%nColors ];\n\t\tdebug( 'Rug color: %s (%d).', color, i );\n\n\t\topacity = state.xRugOpacity[ i%nOpacities ];\n\t\tdebug( 'Rug opacity: %d (%d).', opacity, i );\n\n\t\torient = state.xRugOrient[ i%nOrients ];\n\t\tdebug( 'Rug orientation: %s (%d).', orient, i );\n\n\t\tsize = state.xRugSize[ i%nSizes ];\n\t\tdebug( 'Rug tick size: %d (%d).', size, i );\n\n\t\trug.data = state.x[ i ];\n\t\trug.label = state.labels[ i ] || '';\n\t\trug.color = color;\n\t\trug.size = size;\n\t\trug.opacity = opacity;\n\t\trug.orientation = orient;\n\n\t\tdebug( 'Rendering x-axis rug %d...', i );\n\t\ttmp = rug.render();\n\n\t\t// Update the class name to indicate this is an x-axis rug and add a transform to translate the rug into position based on the graph dimensions.\n\t\ttmp.properties.className += ' x';\n\t\trugTransform = xRugTransform( orient, state.graphHeight );\n\t\tif ( !tmp.properties.attributes ) {\n\t\t\ttmp.properties.attributes = {};\n\t\t}\n\t\ttmp.properties.attributes.transform = rugTransform;\n\n\t\tmarks.push( tmp );\n\t}\n\tdebug( 'Finished rendering x-axis rug plots.' );\n\treturn marks;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a y-axis rug translation transform.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {number} width - graph width\n* @returns {string} transform\n*/\nfunction yRugTransform( orient, width ) {\n\tif ( orient === 'left' ) {\n\t\treturn 'translate(0,0)';\n\t}\n\treturn 'translate('+width+',0)';\n}\n\n\n// EXPORTS //\n\nexport default yRugTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport yRugTransform from './../utils/y_rug_transform.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:marks:y-rug' );\n\n\n// MAIN //\n\n/**\n* Renders y-axis rug plots.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar rugTransform;\n\tvar nOpacities;\n\tvar nOrients;\n\tvar opacity;\n\tvar nColors;\n\tvar nSizes;\n\tvar orient;\n\tvar nFlgs;\n\tvar color;\n\tvar marks;\n\tvar size;\n\tvar rug;\n\tvar len;\n\tvar tmp;\n\tvar i;\n\n\trug = state.$.svg.yRug;\n\n\tnOpacities = state.yRugOpacity.length;\n\tnOrients = state.yRugOrient.length;\n\tnColors = state.colors.length;\n\tnSizes = state.yRugSize.length;\n\tnFlgs = state.yRug.length;\n\n\tlen = state.y.length;\n\tmarks = [];\n\n\tdebug( 'Rendering y-axis rug plots...' );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( !state.yRug[ i%nFlgs ] ) {\n\t\t\tdebug( 'Rug plot (%d) disabled. Skipping...', i );\n\t\t\tcontinue;\n\t\t}\n\t\tcolor = state.colors[ i%nColors ];\n\t\tdebug( 'Rug color: %s (%d).', color, i );\n\n\t\topacity = state.yRugOpacity[ i%nOpacities ];\n\t\tdebug( 'Rug opacity: %d (%d).', opacity, i );\n\n\t\torient = state.yRugOrient[ i%nOrients ];\n\t\tdebug( 'Rug orientation: %s (%d).', orient, i );\n\n\t\tsize = state.yRugSize[ i%nSizes ];\n\t\tdebug( 'Rug tick size: %d (%d).', size, i );\n\n\t\trug.data = state.y[ i ];\n\t\trug.label = state.labels[ i ] || '';\n\t\trug.color = color;\n\t\trug.size = size;\n\t\trug.opacity = opacity;\n\t\trug.orientation = orient;\n\n\t\tdebug( 'Rendering y-axis rug %d...', i );\n\t\ttmp = rug.render();\n\n\t\t// Update the class name to indicate this is a y-axis rug and add a transform to translate the rug into position based on the graph dimensions.\n\t\ttmp.properties.className += ' y';\n\t\trugTransform = yRugTransform( orient, state.graphWidth );\n\t\tif ( !tmp.properties.attributes ) {\n\t\t\ttmp.properties.attributes = {};\n\t\t}\n\t\ttmp.properties.attributes.transform = rugTransform;\n\n\t\tmarks.push( tmp );\n\t}\n\tdebug( 'Finished rendering y-axis rug plots.' );\n\treturn marks;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport lines from './lines.js';\nimport symbols from './symbols.js';\nimport xRug from './x_rug.js';\nimport yRug from './y_rug.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:marks' );\n\n\n// MAIN //\n\n/**\n* Renders individual marks.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar parent;\n\tvar marks;\n\tvar len;\n\tvar i;\n\n\tdebug( 'Rendering marks group...' );\n\tparent = state.$.svg.marks.render();\n\n\tlen = state.x.length;\n\tif ( len === 0 ) {\n\t\tdebug( 'No individual marks to render.' );\n\t\treturn parent;\n\t}\n\tmarks = [];\n\n\tdebug( 'Rendering lines...' );\n\tmarks = marks.concat( lines( state ) );\n\n\tdebug( 'Rendering symbols...' );\n\tmarks = marks.concat( symbols( state ) );\n\n\tdebug( 'Rendering x-axis rug plots...' );\n\tmarks = marks.concat( xRug( state ) );\n\n\tdebug( 'Rendering y-axis rug plots...' );\n\tmarks = marks.concat( yRug( state ) );\n\n\tdebug( 'Inserting individual marks into marks group...' );\n\tfor ( i = 0; i < marks.length; i++ ) {\n\t\tparent.children.push( marks[i] );\n\t\tparent.count += marks[i].count;\n\t}\n\tdebug( 'Finished rendering marks.' );\n\treturn parent;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","var nativeIsArray = Array.isArray\nvar toString = Object.prototype.toString\n\nmodule.exports = nativeIsArray || isArray\n\nfunction isArray(obj) {\n return toString.call(obj) === \"[object Array]\"\n}\n","module.exports = isHook\n\nfunction isHook(hook) {\n return hook &&\n (typeof hook.hook === \"function\" && !hook.hasOwnProperty(\"hook\") ||\n typeof hook.unhook === \"function\" && !hook.hasOwnProperty(\"unhook\"))\n}\n","var version = require(\"./version\")\nvar isVNode = require(\"./is-vnode\")\nvar isWidget = require(\"./is-widget\")\nvar isThunk = require(\"./is-thunk\")\nvar isVHook = require(\"./is-vhook\")\n\nmodule.exports = VirtualNode\n\nvar noProperties = {}\nvar noChildren = []\n\nfunction VirtualNode(tagName, properties, children, key, namespace) {\n this.tagName = tagName\n this.properties = properties || noProperties\n this.children = children || noChildren\n this.key = key != null ? String(key) : undefined\n this.namespace = (typeof namespace === \"string\") ? namespace : null\n\n var count = (children && children.length) || 0\n var descendants = 0\n var hasWidgets = false\n var hasThunks = false\n var descendantHooks = false\n var hooks\n\n for (var propName in properties) {\n if (properties.hasOwnProperty(propName)) {\n var property = properties[propName]\n if (isVHook(property) && property.unhook) {\n if (!hooks) {\n hooks = {}\n }\n\n hooks[propName] = property\n }\n }\n }\n\n for (var i = 0; i < count; i++) {\n var child = children[i]\n if (isVNode(child)) {\n descendants += child.count || 0\n\n if (!hasWidgets && child.hasWidgets) {\n hasWidgets = true\n }\n\n if (!hasThunks && child.hasThunks) {\n hasThunks = true\n }\n\n if (!descendantHooks && (child.hooks || child.descendantHooks)) {\n descendantHooks = true\n }\n } else if (!hasWidgets && isWidget(child)) {\n if (typeof child.destroy === \"function\") {\n hasWidgets = true\n }\n } else if (!hasThunks && isThunk(child)) {\n hasThunks = true;\n }\n }\n\n this.count = count + descendants\n this.hasWidgets = hasWidgets\n this.hasThunks = hasThunks\n this.hooks = hooks\n this.descendantHooks = descendantHooks\n}\n\nVirtualNode.prototype.version = version\nVirtualNode.prototype.type = \"VirtualNode\"\n","var version = require(\"./version\")\n\nmodule.exports = VirtualText\n\nfunction VirtualText(text) {\n this.text = String(text)\n}\n\nVirtualText.prototype.version = version\nVirtualText.prototype.type = \"VirtualText\"\n","/*!\n * Cross-Browser Split 1.1.1\n * Copyright 2007-2012 Steven Levithan \n * Available under the MIT License\n * ECMAScript compliant, uniform cross-browser split method\n */\n\n/**\n * Splits a string into an array of strings using a regex or string separator. Matches of the\n * separator are not included in the result array. However, if `separator` is a regex that contains\n * capturing groups, backreferences are spliced into the result each time `separator` is matched.\n * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably\n * cross-browser.\n * @param {String} str String to split.\n * @param {RegExp|String} separator Regex or string to use for separating the string.\n * @param {Number} [limit] Maximum number of items to include in the result array.\n * @returns {Array} Array of substrings.\n * @example\n *\n * // Basic use\n * split('a b c d', ' ');\n * // -> ['a', 'b', 'c', 'd']\n *\n * // With limit\n * split('a b c d', ' ', 2);\n * // -> ['a', 'b']\n *\n * // Backreferences in result array\n * split('..word1 word2..', /([a-z]+)(\\d+)/i);\n * // -> ['..', 'word', '1', ' ', 'word', '2', '..']\n */\nmodule.exports = (function split(undef) {\n\n var nativeSplit = String.prototype.split,\n compliantExecNpcg = /()??/.exec(\"\")[1] === undef,\n // NPCG: nonparticipating capturing group\n self;\n\n self = function(str, separator, limit) {\n // If `separator` is not a regex, use `nativeSplit`\n if (Object.prototype.toString.call(separator) !== \"[object RegExp]\") {\n return nativeSplit.call(str, separator, limit);\n }\n var output = [],\n flags = (separator.ignoreCase ? \"i\" : \"\") + (separator.multiline ? \"m\" : \"\") + (separator.extended ? \"x\" : \"\") + // Proposed for ES6\n (separator.sticky ? \"y\" : \"\"),\n // Firefox 3+\n lastLastIndex = 0,\n // Make `global` and avoid `lastIndex` issues by working with a copy\n separator = new RegExp(separator.source, flags + \"g\"),\n separator2, match, lastIndex, lastLength;\n str += \"\"; // Type-convert\n if (!compliantExecNpcg) {\n // Doesn't need flags gy, but they don't hurt\n separator2 = new RegExp(\"^\" + separator.source + \"$(?!\\\\s)\", flags);\n }\n /* Values for `limit`, per the spec:\n * If undefined: 4294967295 // Math.pow(2, 32) - 1\n * If 0, Infinity, or NaN: 0\n * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;\n * If negative number: 4294967296 - Math.floor(Math.abs(limit))\n * If other: Type-convert, then use the above rules\n */\n limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1\n limit >>> 0; // ToUint32(limit)\n while (match = separator.exec(str)) {\n // `separator.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0].length;\n if (lastIndex > lastLastIndex) {\n output.push(str.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for\n // nonparticipating capturing groups\n if (!compliantExecNpcg && match.length > 1) {\n match[0].replace(separator2, function() {\n for (var i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undef) {\n match[i] = undef;\n }\n }\n });\n }\n if (match.length > 1 && match.index < str.length) {\n Array.prototype.push.apply(output, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= limit) {\n break;\n }\n }\n if (separator.lastIndex === match.index) {\n separator.lastIndex++; // Avoid an infinite loop\n }\n }\n if (lastLastIndex === str.length) {\n if (lastLength || !separator.test(\"\")) {\n output.push(\"\");\n }\n } else {\n output.push(str.slice(lastLastIndex));\n }\n return output.length > limit ? output.slice(0, limit) : output;\n };\n\n return self;\n})();\n","'use strict';\n\nvar split = require('browser-split');\n\nvar classIdSplit = /([\\.#]?[a-zA-Z0-9\\u007F-\\uFFFF_:-]+)/;\nvar notClassId = /^\\.|#/;\n\nmodule.exports = parseTag;\n\nfunction parseTag(tag, props) {\n if (!tag) {\n return 'DIV';\n }\n\n var noId = !(props.hasOwnProperty('id'));\n\n var tagParts = split(tag, classIdSplit);\n var tagName = null;\n\n if (notClassId.test(tagParts[1])) {\n tagName = 'DIV';\n }\n\n var classes, part, type, i;\n\n for (i = 0; i < tagParts.length; i++) {\n part = tagParts[i];\n\n if (!part) {\n continue;\n }\n\n type = part.charAt(0);\n\n if (!tagName) {\n tagName = part;\n } else if (type === '.') {\n classes = classes || [];\n classes.push(part.substring(1, part.length));\n } else if (type === '#' && noId) {\n props.id = part.substring(1, part.length);\n }\n }\n\n if (classes) {\n if (props.className) {\n classes.push(props.className);\n }\n\n props.className = classes.join(' ');\n }\n\n return props.namespace ? tagName : tagName.toUpperCase();\n}\n","'use strict';\n\n/*global window, global*/\n\nvar root = typeof window !== 'undefined' ?\n window : typeof global !== 'undefined' ?\n global : {};\n\nmodule.exports = Individual;\n\nfunction Individual(key, value) {\n if (key in root) {\n return root[key];\n }\n\n root[key] = value;\n\n return value;\n}\n","'use strict';\n\nvar Individual = require('./index.js');\n\nmodule.exports = OneVersion;\n\nfunction OneVersion(moduleName, version, defaultValue) {\n var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;\n var enforceKey = key + '_ENFORCE_SINGLETON';\n\n var versionValue = Individual(enforceKey, version);\n\n if (versionValue !== version) {\n throw new Error('Can only have one copy of ' +\n moduleName + '.\\n' +\n 'You already have version ' + versionValue +\n ' installed.\\n' +\n 'This means you cannot install version ' + version);\n }\n\n return Individual(key, defaultValue);\n}\n","'use strict';\n\nvar OneVersionConstraint = require('individual/one-version');\n\nvar MY_VERSION = '7';\nOneVersionConstraint('ev-store', MY_VERSION);\n\nvar hashKey = '__EV_STORE_KEY@' + MY_VERSION;\n\nmodule.exports = EvStore;\n\nfunction EvStore(elem) {\n var hash = elem[hashKey];\n\n if (!hash) {\n hash = elem[hashKey] = {};\n }\n\n return hash;\n}\n","'use strict';\n\nvar EvStore = require('ev-store');\n\nmodule.exports = EvHook;\n\nfunction EvHook(value) {\n if (!(this instanceof EvHook)) {\n return new EvHook(value);\n }\n\n this.value = value;\n}\n\nEvHook.prototype.hook = function (node, propertyName) {\n var es = EvStore(node);\n var propName = propertyName.substr(3);\n\n es[propName] = this.value;\n};\n\nEvHook.prototype.unhook = function(node, propertyName) {\n var es = EvStore(node);\n var propName = propertyName.substr(3);\n\n es[propName] = undefined;\n};\n","'use strict';\n\nvar isArray = require('x-is-array');\n\nvar VNode = require('../vnode/vnode.js');\nvar VText = require('../vnode/vtext.js');\nvar isVNode = require('../vnode/is-vnode');\nvar isVText = require('../vnode/is-vtext');\nvar isWidget = require('../vnode/is-widget');\nvar isHook = require('../vnode/is-vhook');\nvar isVThunk = require('../vnode/is-thunk');\n\nvar parseTag = require('./parse-tag.js');\nvar softSetHook = require('./hooks/soft-set-hook.js');\nvar evHook = require('./hooks/ev-hook.js');\n\nmodule.exports = h;\n\nfunction h(tagName, properties, children) {\n var childNodes = [];\n var tag, props, key, namespace;\n\n if (!children && isChildren(properties)) {\n children = properties;\n props = {};\n }\n\n props = props || properties || {};\n tag = parseTag(tagName, props);\n\n // support keys\n if (props.hasOwnProperty('key')) {\n key = props.key;\n props.key = undefined;\n }\n\n // support namespace\n if (props.hasOwnProperty('namespace')) {\n namespace = props.namespace;\n props.namespace = undefined;\n }\n\n // fix cursor bug\n if (tag === 'INPUT' &&\n !namespace &&\n props.hasOwnProperty('value') &&\n props.value !== undefined &&\n !isHook(props.value)\n ) {\n props.value = softSetHook(props.value);\n }\n\n transformProperties(props);\n\n if (children !== undefined && children !== null) {\n addChild(children, childNodes, tag, props);\n }\n\n\n return new VNode(tag, props, childNodes, key, namespace);\n}\n\nfunction addChild(c, childNodes, tag, props) {\n if (typeof c === 'string') {\n childNodes.push(new VText(c));\n } else if (typeof c === 'number') {\n childNodes.push(new VText(String(c)));\n } else if (isChild(c)) {\n childNodes.push(c);\n } else if (isArray(c)) {\n for (var i = 0; i < c.length; i++) {\n addChild(c[i], childNodes, tag, props);\n }\n } else if (c === null || c === undefined) {\n return;\n } else {\n throw UnexpectedVirtualElement({\n foreignObject: c,\n parentVnode: {\n tagName: tag,\n properties: props\n }\n });\n }\n}\n\nfunction transformProperties(props) {\n for (var propName in props) {\n if (props.hasOwnProperty(propName)) {\n var value = props[propName];\n\n if (isHook(value)) {\n continue;\n }\n\n if (propName.substr(0, 3) === 'ev-') {\n // add ev-foo support\n props[propName] = evHook(value);\n }\n }\n }\n}\n\nfunction isChild(x) {\n return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x);\n}\n\nfunction isChildren(x) {\n return typeof x === 'string' || isArray(x) || isChild(x);\n}\n\nfunction UnexpectedVirtualElement(data) {\n var err = new Error();\n\n err.type = 'virtual-hyperscript.unexpected.virtual-element';\n err.message = 'Unexpected virtual child passed to h().\\n' +\n 'Expected a VNode / Vthunk / VWidget / string but:\\n' +\n 'got:\\n' +\n errorString(data.foreignObject) +\n '.\\n' +\n 'The parent vnode is:\\n' +\n errorString(data.parentVnode)\n '\\n' +\n 'Suggested fix: change your `h(..., [ ... ])` callsite.';\n err.foreignObject = data.foreignObject;\n err.parentVnode = data.parentVnode;\n\n return err;\n}\n\nfunction errorString(obj) {\n try {\n return JSON.stringify(obj, null, ' ');\n } catch (e) {\n return String(obj);\n }\n}\n","var h = require(\"./virtual-hyperscript/index.js\")\n\nmodule.exports = h\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'annotations:render' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar vtree;\n\tvar props;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'annotations',\n\t\t'className': 'annotations',\n\t\t'attributes': {\n\t\t\t'transform': 'translate(0,0)'\n\t\t}\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport inherit from '@stdlib/utils/inherit';\nimport instanceOf from '@stdlib/assert/instance-of';\nimport render from './render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'annotations:main' );\n\n\n// MAIN //\n\n/**\n* Annotations constructor.\n*\n* @constructor\n* @returns {Annotations} annotations instance\n*\n* @example\n* var node = new Annotations();\n*/\nfunction Annotations() {\n\tvar self;\n\tif ( !instanceOf( this, Annotations ) ) {\n\t\treturn new Annotations();\n\t}\n\tself = this;\n\tdebug( 'Creating an instance...' );\n\tEventEmitter.call( this );\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tself.render();\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Inherit from the `EventEmitter` prototype.\n*/\ninherit( Annotations, EventEmitter );\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Annotations.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var node = new Annotations();\n*\n* var vtree = node.render();\n* // returns \n*/\nsetReadOnly( Annotations.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Annotations;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `width`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `height`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `id`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isString( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'id', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport width from './width.js';\nimport height from './height.js';\nimport id from './id.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'width': width,\n\t'height': height,\n\t'id': id,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {PositiveNumber} [options.width] - width\n* @param {PositiveNumber} [options.height] - height\n* @param {string} [options.id] - clipping path id\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'width': 400,\n* 'height': 400\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/width.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:set:width' );\nvar CHANGE_EVENT = events( 'width' );\n\n\n// MAIN //\n\n/**\n* Sets the width.\n*\n* @private\n* @param {PositiveNumber} width - width\n* @throws {TypeError} must be a positive number\n*/\nfunction set( width ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( width );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._width );\n\n\tthis._width = width;\n\tdebug( 'New value: %d.', this._width );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/height.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:set:height' );\nvar CHANGE_EVENT = events( 'height' );\n\n\n// MAIN //\n\n/**\n* Sets the height.\n*\n* @private\n* @param {PositiveNumber} height - height\n* @throws {TypeError} must be a positive number\n*/\nfunction set( height ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( height );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._height );\n\n\tthis._height = height;\n\tdebug( 'New Value: %d.', this._height );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/id.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:set:id' );\nvar CHANGE_EVENT = events( 'id' );\n\n\n// MAIN //\n\n/**\n* Sets the clipping path id.\n*\n* @private\n* @param {string} id - id\n* @throws {TypeError} must be a string\n*/\nfunction set( id ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( id );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', this._id );\n\n\tthis._id = id;\n\tdebug( 'New value: %s.', this._id );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clip-path:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:components:rect' );\nvar ELEMENT = 'rect';\n\n\n// MAIN //\n\n/**\n* Renders a clipping path rectangle.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\tvar props = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'className': 'clipPath',\n\t\t'attributes': {\n\t\t\t'width': ctx.width,\n\t\t\t'height': ctx.height\n\t\t}\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, [] );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport rect from './rect.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:components:main' );\nvar ELEMENT = 'clipPath';\n\n\n// MAIN //\n\n/**\n* Renders a clipping path.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\tvar children;\n\tvar props;\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'id': ctx.id\n\t};\n\n\tdebug( 'Rendering clipping path rectangle...' );\n\tchildren = [\n\t\trect( ctx )\n\t];\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, children );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport components from './../components';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:render' );\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\tvtree = components( this );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport minstd from '@stdlib/random/base/minstd';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setWidth from './props/width/set.js';\nimport getWidth from './props/width/get.js';\nimport setHeight from './props/height/set.js';\nimport getHeight from './props/height/get.js';\nimport setID from './props/id/set.js';\nimport getID from './props/id/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'clippath:main' );\n\n\n// MAIN //\n\n/**\n* Clipping path constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {PositiveNumber} [options.width=400] - width\n* @param {PositiveNumber} [options.height=400] - height\n* @param {string} [options.id] - clipping path id\n* @param {boolean} [options.autoRender=true] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {ClipPath} clipping path instance\n*\n* @example\n* var clipPath = new ClipPath({\n* 'width': 500,\n* 'height': 500\n* });\n*/\nfunction ClipPath( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof ClipPath ) ) {\n\t\treturn new ClipPath( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_width', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.width\n\t});\n\tdefineProperty( this, '_height', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.height\n\t});\n\tdefineProperty( this, '_id', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.id || minstd().toString() // TODO: uuid\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nClipPath.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nClipPath.prototype.constructor = ClipPath;\n\n/**\n* Width.\n*\n* @name width\n* @memberof ClipPath.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var clipPath = new ClipPath({\n* 'width': 500\n* });\n*\n* var width = clipPath.width;\n* // returns 500\n*/\ndefineProperty( ClipPath.prototype, 'width', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setWidth,\n\t'get': getWidth\n});\n\n/**\n* Height.\n*\n* @name height\n* @memberof ClipPath.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var clipPath = new ClipPath({\n* 'height': 500\n* });\n*\n* var height = clipPath.height;\n* // returns 500\n*/\ndefineProperty( ClipPath.prototype, 'height', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setHeight,\n\t'get': getHeight\n});\n\n/**\n* Clipping path id.\n*\n* @name id\n* @memberof ClipPath.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var clipPath = new ClipPath({\n* 'id': '1234'\n* });\n*\n* var id = clipPath.id;\n* // returns '1234'\n*/\ndefineProperty( ClipPath.prototype, 'id', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setID,\n\t'get': getID\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof ClipPath.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var clipPath = new ClipPath({\n* 'autoRender': true\n* });\n*\n* var mode = clipPath.autoRender;\n* // returns true\n*/\ndefineProperty( ClipPath.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof ClipPath.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var clipPath = new ClipPath();\n*\n* var out = clipPath.render();\n*/\nsetReadOnly( ClipPath.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default ClipPath;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the width.\n*\n* @private\n* @returns {number} width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the height.\n*\n* @private\n* @returns {number} height\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._height;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the clipping path id.\n*\n* @private\n* @returns {string} id\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._id;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `width`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `height`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport width from './width.js';\nimport height from './height.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'width': width,\n\t'height': height,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {PositiveNumber} [options.width] - width\n* @param {PositiveNumber} [options.height] - height\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'width': 400,\n* 'height': 400\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/width.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:set:width' );\nvar CHANGE_EVENT = events( 'width' );\n\n\n// MAIN //\n\n/**\n* Sets the width.\n*\n* @private\n* @param {PositiveNumber} width - width\n* @throws {TypeError} must be a positive number\n*/\nfunction set( width ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( width );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._width );\n\n\tthis._width = width;\n\tdebug( 'New value: %d.', this._width );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/height.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:set:height' );\nvar CHANGE_EVENT = events( 'height' );\n\n\n// MAIN //\n\n/**\n* Sets the height.\n*\n* @private\n* @param {PositiveNumber} height - height\n* @throws {TypeError} must be a positive number\n*/\nfunction set( height ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( height );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._height );\n\n\tthis._height = height;\n\tdebug( 'New Value: %d.', this._height );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:render' );\nvar ELEMENT = 'svg';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'canvas',\n\t\t'className': 'canvas',\n\t\t'attributes': {\n\t\t\t'width': this.width,\n\t\t\t'height': this.height\n\t\t}\n\t};\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setWidth from './props/width/set.js';\nimport getWidth from './props/width/get.js';\nimport setHeight from './props/height/set.js';\nimport getHeight from './props/height/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:main' );\n\n\n// MAIN //\n\n/**\n* Canvas constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {PositiveNumber} [options.width=400] - width\n* @param {PositiveNumber} [options.height=400] - height\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Canvas} canvas instance\n*\n* @example\n* var canvas = new Canvas({\n* 'width': 500,\n* 'height': 500\n* });\n*/\nfunction Canvas( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Canvas ) ) {\n\t\treturn new Canvas( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_width', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.width\n\t});\n\tdefineProperty( this, '_height', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.height\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nCanvas.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nCanvas.prototype.constructor = Canvas;\n\n/**\n* Width.\n*\n* @name width\n* @memberof Canvas.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var canvas = new Canvas({\n* 'width': 500\n* });\n*\n* var width = canvas.width;\n* // returns 500\n*/\ndefineProperty( Canvas.prototype, 'width', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setWidth,\n\t'get': getWidth\n});\n\n/**\n* Height.\n*\n* @name height\n* @memberof Canvas.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var canvas = new Canvas({\n* 'height': 500\n* });\n*\n* var height = canvas.height;\n* // returns 500\n*/\ndefineProperty( Canvas.prototype, 'height', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setHeight,\n\t'get': getHeight\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Canvas.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var canvas = new Canvas({\n* 'autoRender': true\n* });\n*\n* var mode = canvas.autoRender;\n* // returns true\n*/\ndefineProperty( Canvas.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Canvas.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var canvas = new Canvas({});\n*\n* var out = canvas.render();\n*/\nsetReadOnly( Canvas.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Canvas;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the width.\n*\n* @private\n* @returns {number} width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the height.\n*\n* @private\n* @returns {number} height\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._height;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `translateX`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'translateX', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `translateY`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'translateY', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport translateX from './translate_x.js';\nimport translateY from './translate_y.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'translateX': translateX,\n\t'translateY': translateY,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.translateX] - horizontal translation\n* @param {NonNegativeInteger} [options.translateY] - vertical translation\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'translateX': 90,\n* 'translateY': 20\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/translate_x.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'graph:set:translate-x' );\nvar CHANGE_EVENT = events( 'translateX' );\n\n\n// MAIN //\n\n/**\n* Sets the horizontal translation.\n*\n* @private\n* @param {NonNegativeInteger} v - translation\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( v );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._translateX );\n\n\tthis._translateX = v;\n\tdebug( 'New Value: %d.', this._translateX );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/translate_y.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'graph:set:translate-y' );\nvar CHANGE_EVENT = events( 'translateY' );\n\n\n// MAIN //\n\n/**\n* Sets the vertical translation.\n*\n* @private\n* @param {NonNegativeInteger} v - translation\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( v );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._translateY );\n\n\tthis._translateY = v;\n\tdebug( 'New Value: %d.', this._translateY );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'canvas:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'graph:render' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'graph',\n\t\t'className': 'graph',\n\t\t'attributes': {\n\t\t\t'transform': 'translate('+this.translateX+','+this.translateY+')'\n\t\t}\n\t};\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setTranslateX from './props/translate-x/set.js';\nimport getTranslateX from './props/translate-x/get.js';\nimport setTranslateY from './props/translate-y/set.js';\nimport getTranslateY from './props/translate-y/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'graph:main' );\n\n\n// MAIN //\n\n/**\n* Graph constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {NonNegativeInteger} [options.translateX=0] - horizontal translation\n* @param {NonNegativeInteger} [options.translateY=0] - vertical translation\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Graph} graph instance\n*\n* @example\n* var graph = new Graph({\n* 'translateX': 90,\n* 'translateY': 20\n* });\n*/\nfunction Graph( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Graph ) ) {\n\t\treturn new Graph( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_translateX', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.translateX\n\t});\n\tdefineProperty( this, '_translateY', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.translateY\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nGraph.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nGraph.prototype.constructor = Graph;\n\n/**\n* Horizontal translation.\n*\n* @name translateX\n* @memberof Graph.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 0\n*\n* @example\n* var graph = new Graph({\n* 'translateX': 90\n* });\n*\n* var v = graph.translateX;\n* // returns 90\n*/\ndefineProperty( Graph.prototype, 'translateX', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTranslateX,\n\t'get': getTranslateX\n});\n\n/**\n* Vertical translation.\n*\n* @name translateY\n* @memberof Graph.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 0\n*\n* @example\n* var graph = new Graph({\n* 'translateY': 20\n* });\n*\n* var v = graph.translateY;\n* // returns 20\n*/\ndefineProperty( Graph.prototype, 'translateY', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTranslateY,\n\t'get': getTranslateY\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Graph.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var graph = new Graph({\n* 'autoRender': true\n* });\n*\n* var mode = graph.autoRender;\n* // returns true\n*/\ndefineProperty( Graph.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Graph.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var graph = new Graph();\n*\n* var out = graph.render();\n*/\nsetReadOnly( Graph.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Graph;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the horizontal translation.\n*\n* @private\n* @returns {NonNegativeInteger} translation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._translateX;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the vertical translation.\n*\n* @private\n* @returns {NonNegativeInteger} translation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._translateY;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `text`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isString( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'text', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport text from './text.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'text': text,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.text] - title text\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'text': 'Beep'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/text.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'title:set:text' );\nvar CHANGE_EVENT = events( 'text' );\n\n\n// MAIN //\n\n/**\n* Sets the title text.\n*\n* @private\n* @param {string} text - text\n* @throws {TypeError} must be a string\n*/\nfunction set( text ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( text );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._text );\n\n\tthis._text = text;\n\tdebug( 'New Value: %d.', this._text );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'title:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'title:render' );\nvar ELEMENT = 'text';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\tvar text;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'title',\n\t\t'className': 'title noselect',\n\t\t'attributes': {\n\t\t\t'x': 0,\n\t\t\t'y': 0,\n\t\t\t'text-anchor': 'middle'\n\t\t}\n\t};\n\n\ttext = this.text;\n\tdebug( 'Title: %s.', text );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, text );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setText from './props/text/set.js';\nimport getText from './props/text/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'title:main' );\n\n\n// MAIN //\n\n/**\n* Title constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {string} [options.text] - title text\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Title} title instance\n*\n* @example\n* var title = new Title({\n* 'text':'Beep'\n* });\n*/\nfunction Title( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Title ) ) {\n\t\treturn new Title( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_text', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.text\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nTitle.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nTitle.prototype.constructor = Title;\n\n/**\n* Title text.\n*\n* @name text\n* @memberof Title.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var title = new Title({\n* 'text': 'Beep'\n* });\n*\n* var text = title.text;\n* // returns 'Beep'\n*/\ndefineProperty( Title.prototype, 'text', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setText,\n\t'get': getText\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Title.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var title = new Title({\n* 'autoRender': true\n* });\n*\n* var mode = title.autoRender;\n* // returns true\n*/\ndefineProperty( Title.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Title.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var title = new Title();\n*\n* var out = title.render();\n*/\nsetReadOnly( Title.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Title;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the title text.\n*\n* @private\n* @returns {string} text\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._text;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `clipPathId`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isString( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'clipPathId', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport clipPathId from './clip_path_id.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'clipPathId': clipPathId,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.clipPathId] - clipping path id\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'clipPathId': '1234'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/clip_path_id.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'marks:set:clip-path-id' );\nvar CHANGE_EVENT = events( 'clipPathId' );\n\n\n// MAIN //\n\n/**\n* Sets the clipping path id.\n*\n* @private\n* @param {string} id - clipping path id\n* @throws {TypeError} must be a string\n*/\nfunction set( id ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( id );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._clipPathId );\n\n\tthis._clipPathId = id;\n\tdebug( 'New Value: %d.', this._clipPathId );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'marks:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'marks:render' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'marks',\n\t\t'className': 'marks',\n\t\t'attributes': {\n\t\t\t'clip-path': 'url(#'+this._clipPathId+')'\n\t\t}\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setClipPathId from './props/clip-path-id/set.js';\nimport getClipPathId from './props/clip-path-id/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'marks:main' );\n\n\n// MAIN //\n\n/**\n* Marks constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {string} [options.clipPathId] - clipping path id\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Marks} marks instance\n*\n* @example\n* var marks = new Marks({\n* 'clipPathId': '1234'\n* });\n*/\nfunction Marks( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Marks ) ) {\n\t\treturn new Marks( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_clipPathId', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.clipPathId\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nMarks.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nMarks.prototype.constructor = Marks;\n\n/**\n* Clipping path id.\n*\n* @name clipPathId\n* @memberof Marks.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var marks = new Marks({\n* 'clipPathId': '1234'\n* });\n*\n* var id = marks.clipPathId;\n* // returns '1234'\n*/\ndefineProperty( Marks.prototype, 'clipPathId', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setClipPathId,\n\t'get': getClipPathId\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Marks.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var marks = new Marks({\n* 'autoRender': true\n* });\n*\n* var mode = marks.autoRender;\n* // returns true\n*/\ndefineProperty( Marks.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Marks.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var marks = new Marks();\n*\n* var out = marks.render();\n*/\nsetReadOnly( Marks.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Marks;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the clipping path id.\n*\n* @private\n* @returns {string} id\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._clipPathId;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `width`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'width', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveNumber } from '@stdlib/assert/is-positive-number';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `height`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isPositiveNumber( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a positive number. Value: `%s`.', 'height', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport width from './width.js';\nimport height from './height.js';\nimport autoRender from './auto_render.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'width': width,\n\t'height': height,\n\t'autoRender': autoRender\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {PositiveNumber} [options.width] - width\n* @param {PositiveNumber} [options.height] - height\n* @param {boolean} [options.autoRender] - indicates whether to re-render on a change event\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'width': 400,\n* 'height': 400\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/width.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'background:set:width' );\nvar CHANGE_EVENT = events( 'width' );\n\n\n// MAIN //\n\n/**\n* Sets the width.\n*\n* @private\n* @param {PositiveNumber} width - width\n* @throws {TypeError} must be a positive number\n*/\nfunction set( width ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( width );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._width );\n\n\tthis._width = width;\n\tdebug( 'New value: %d.', this._width );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/height.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'background:set:height' );\nvar CHANGE_EVENT = events( 'height' );\n\n\n// MAIN //\n\n/**\n* Sets the height.\n*\n* @private\n* @param {PositiveNumber} height - height\n* @throws {TypeError} must be a positive number\n*/\nfunction set( height ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( height );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._height );\n\n\tthis._height = height;\n\tdebug( 'New Value: %d.', this._height );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'background:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'background:render' );\nvar ELEMENT = 'rect';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'className': 'background',\n\t\t'attributes': {\n\t\t\t'x': 0,\n\t\t\t'y': 0,\n\t\t\t'width': this.width,\n\t\t\t'height': this.height,\n\t\t\t'fill': 'none',\n\t\t\t'stroke': 'none'\n\t\t}\n\t};\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setWidth from './props/width/set.js';\nimport getWidth from './props/width/get.js';\nimport setHeight from './props/height/set.js';\nimport getHeight from './props/height/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'background:main' );\n\n\n// MAIN //\n\n/**\n* Background constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {PositiveNumber} [options.width=400] - width\n* @param {PositiveNumber} [options.height=400] - height\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Background} background instance\n*\n* @example\n* var bkgd = new Background({\n* 'width': 500,\n* 'height': 500\n* });\n*/\nfunction Background( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Background ) ) {\n\t\treturn new Background( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_width', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.width\n\t});\n\tdefineProperty( this, '_height', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.height\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nBackground.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nBackground.prototype.constructor = Background;\n\n/**\n* Width.\n*\n* @name width\n* @memberof Background.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var bkgd = new Background({\n* 'width': 500\n* });\n*\n* var width = bkgd.width;\n* // returns 500\n*/\ndefineProperty( Background.prototype, 'width', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setWidth,\n\t'get': getWidth\n});\n\n/**\n* Height.\n*\n* @name height\n* @memberof Background.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400\n*\n* @example\n* var bkgd = new Background({\n* 'height': 500\n* });\n*\n* var height = bkgd.height;\n* // returns 500\n*/\ndefineProperty( Background.prototype, 'height', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setHeight,\n\t'get': getHeight\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Background.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var bkgd = new Background({\n* 'autoRender': true\n* });\n*\n* var mode = bkgd.autoRender;\n* // returns true\n*/\ndefineProperty( Background.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Background.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var bkgd = new Background();\n*\n* var out = bkgd.render();\n*/\nsetReadOnly( Background.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Background;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the width.\n*\n* @private\n* @returns {number} width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the height.\n*\n* @private\n* @returns {number} height\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._height;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'defs:render' );\nvar ELEMENT = 'defs';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar vtree;\n\tvar props;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg'\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport inherit from '@stdlib/utils/inherit';\nimport instanceOf from '@stdlib/assert/instance-of';\nimport render from './render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'defs:main' );\n\n\n// MAIN //\n\n/**\n* SVG definitions constructor.\n*\n* @constructor\n* @returns {Defs} definitions instance\n*\n* @example\n* var node = new Defs();\n* // returns \n*/\nfunction Defs() {\n\tvar self;\n\tif ( !instanceOf( this, Defs ) ) {\n\t\treturn new Defs();\n\t}\n\tself = this;\n\tdebug( 'Creating an instance...' );\n\tEventEmitter.call( this );\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tself.render();\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Inherit from the `EventEmitter` prototype.\n*/\ninherit( Defs, EventEmitter );\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Defs.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var node = new Defs();\n*\n* var out = node.render();\n* // returns \n*/\nsetReadOnly( Defs.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Defs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `autoRender`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isBoolean( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `label`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isString( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'label', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `numTicks`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif (\n\t\t!isNull( v ) &&\n\t\t!isNonNegativeInteger( v )\n\t) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or null. Value: `%s`.', 'numTicks', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './../etc/orientations.json';\n\n\n// MAIN //\n\n/**\n* Validates `orientation`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( indexOf( ORIENTATIONS, v ) === -1 ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be one of the following: \"%s\". Value: `%s`.', 'orientation', ORIENTATIONS.join( '\", \"' ), v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `scale`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isFunction( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'scale', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `tickFormat`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif (\n\t\t!isNull( v ) &&\n\t\t!isString( v ) &&\n\t\t!isFunction( v )\n\t) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a string, function, or null. Value: `%s`.', 'tickFormat', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `tickPadding`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'tickPadding', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport isArray from '@stdlib/assert/is-array';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `ticks`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif (\n\t\t!isNull( v ) &&\n\t\t!isArray( v )\n\t) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be null or an array. Value: `%s`.', 'ticks', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `tickSize`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'tickSize', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `innerTickSize`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'innerTickSize', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates `outerTickSize`.\n*\n* @private\n* @param {*} v - value to test\n* @returns {(Error|null)} error object or null\n*/\nfunction test( v ) {\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\treturn new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'outerTickSize', v ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport autoRender from './auto_render.js';\nimport label from './label.js';\nimport numTicks from './num_ticks.js';\nimport orientation from './orientation.js';\nimport scale from './scale.js';\nimport tickFormat from './tick_format.js';\nimport tickPadding from './tick_padding.js';\nimport ticks from './ticks.js';\nimport tickSize from './tick_size.js';\nimport innerTickSize from './inner_tick_size.js';\nimport outerTickSize from './outer_tick_size.js';\n\n\n// MAIN //\n\nvar validators = {\n\t'autoRender': autoRender,\n\t'label': label,\n\t'numTicks': numTicks,\n\t'orientation': orientation,\n\t'scale': scale,\n\t'tickFormat': tickFormat,\n\t'tickPadding': tickPadding,\n\t'ticks': ticks,\n\t'tickSize': tickSize,\n\t'innerTickSize': innerTickSize,\n\t'outerTickSize': outerTickSize\n};\n\n\n// EXPORTS //\n\nexport default validators;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport format from '@stdlib/string/format';\nimport validators from './validators';\n\n\n// VARIABLES //\n\nvar KEYS = objectKeys( validators );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {Function} [options.scale] - scale function\n* @param {string} [options.orientation] - axis orientation\n* @param {string} [options.label] - axis label\n* @param {(Array|null)} [options.ticks] - tick values\n* @param {(NonNegativeInteger|null)} [options.numTicks] - number of ticks\n* @param {(null|string|Function)} [options.tickFormat] - tick format\n* @param {NonNegativeInteger} [options.tickSize] - tick size\n* @param {NonNegativeInteger} [options.innerTickSize] - inner tick size\n* @param {NonNegativeInteger} [options.outerTickSize] - outer tick size\n* @param {NonNegativeInteger} [options.tickPadding] - tick padding\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'scale': function scale(){},\n* 'orientation': 'left',\n* 'tickSize': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tvar err;\n\tvar key;\n\tvar val;\n\tvar i;\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tfor ( i = 0; i < KEYS.length; i++ ) {\n\t\tkey = KEYS[ i ];\n\t\tif ( hasOwnProp( options, key ) ) {\n\t\t\tval = options[ key ];\n\t\t\terr = validators[ key ]( val );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\topts[ key ] = val;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport EVENTS from './events.json';\n\n\n// MAIN //\n\n/**\n* Provided a property, returns a corresponding event name for when a property value changes.\n*\n* @private\n* @param {string} prop - property\n* @returns {string} event name\n*/\nfunction get( prop ) {\n\treturn EVENTS[ prop ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/scale.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:scale' );\nvar CHANGE_EVENT = events( 'scale' );\n\n\n// MAIN //\n\n/**\n* Sets the scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( fcn );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', this._scale );\n\n\tthis._scale = fcn;\n\tdebug( 'New Value: %s.', this._scale );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/orientation.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:orientation' );\nvar CHANGE_EVENT = events( 'orientation' );\n\n\n// MAIN //\n\n/**\n* Sets the axis orientation.\n*\n* @private\n* @param {string} orient - axis orientation\n* @throws {TypeError} must be a string\n*/\nfunction set( orient ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( orient );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', this._orientation );\n\n\tthis._orientation = orient;\n\tdebug( 'New Value: %s.', this._orientation );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/label.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:xlabel' );\nvar CHANGE_EVENT = events( 'label' );\n\n\n// MAIN //\n\n/**\n* Sets the axis label.\n*\n* @private\n* @param {string} label - axis label\n* @throws {TypeError} must be a string\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( label );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', this._label );\n\n\tthis._label = label;\n\tdebug( 'New value: %s.', this._label );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isNull from '@stdlib/assert/is-null';\nimport events from './../../events';\nimport isValid from './../../validators/ticks.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:ticks' );\nvar CHANGE_EVENT = events( 'ticks' );\n\n\n// MAIN //\n\n/**\n* Sets the axis tick values.\n*\n* @private\n* @param {(Array|null)} ticks - tick values\n* @throws {TypeError} must be an array or null\n*/\nfunction set( ticks ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( ticks );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._ticks ) );\n\n\tif ( isNull( ticks ) ) {\n\t\tthis._ticks = ticks;\n\t} else {\n\t\tthis._ticks = ticks.slice();\n\t}\n\tdebug( 'New Value: %s.', JSON.stringify( this._ticks ) );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/num_ticks.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:numticks' );\nvar CHANGE_EVENT = events( 'numTicks' );\n\n\n// MAIN //\n\n/**\n* Sets the number of axis ticks.\n*\n* @private\n* @param {(NonNegativeInteger|null)} num - num\n* @throws {TypeError} must be a nonnegative integer or null\n*/\nfunction set( num ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( num );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', num );\n\n\tthis._numTicks = num;\n\tdebug( 'New Value: %s.', this._numTicks );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/tick_format.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:tickformat' );\nvar CHANGE_EVENT = events( 'tickFormat' );\n\n\n// MAIN //\n\n/**\n* Sets the axis tick format.\n*\n* @private\n* @param {(null|string|Function)} fmt - tick format\n* @throws {TypeError} must be either null, a string, or a function\n*/\nfunction set( fmt ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( fmt );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %s.', this._tickFormat );\n\n\tthis._tickFormat = fmt;\n\tdebug( 'New Value: %s.', this._tickFormat );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Identity function.\n*\n* @param {*} x - input value\n* @returns {*} input value\n*\n* @example\n* var v = identity( 3.14 );\n* // returns 3.14\n*/\nfunction identity( x ) {\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default identity;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( 'd3-format' ).format; // TODO: remove\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isNull from '@stdlib/assert/is-null';\nimport identity from '@stdlib/utils/identity-function';\n\n\n// MAIN //\n\n/**\n* Returns the axis tick format.\n*\n* @private\n* @returns {Function} format function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tif ( isString( this._tickFormat ) ) {\n\t\treturn format( this._tickFormat );\n\t}\n\tif ( isNull( this._tickFormat ) ) {\n\t\tif ( this._scale.tickFormat ) {\n\t\t\treturn this._scale.tickFormat( this._numTicks, this._tickFormat );\n\t\t}\n\t\treturn identity;\n\t}\n\treturn this._tickFormat;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/tick_size.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:ticksize' );\nvar CHANGE_EVENT = events( 'tickSize' );\n\n\n// MAIN //\n\n/**\n* Sets the axis tick size.\n*\n* @private\n* @param {NonNegativeInteger} size - size\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( size ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( size );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', size );\n\n\tthis._tickSize = size;\n\tdebug( 'New Value: %s.', this._tickSize );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/inner_tick_size.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:ticksize-inner' );\nvar CHANGE_EVENT = events( 'innerTickSize' );\n\n\n// MAIN //\n\n/**\n* Sets the inner tick size.\n*\n* @private\n* @param {NonNegativeInteger} size - size\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( size ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( size );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', size );\n\n\tthis._innerTickSize = size;\n\tdebug( 'New Value: %s.', this._innerTickSize );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/outer_tick_size.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:ticksize-outer' );\nvar CHANGE_EVENT = events( 'outerTickSize' );\n\n\n// MAIN //\n\n/**\n* Sets the axis outer tick size.\n*\n* @private\n* @param {NonNegativeInteger} size - size\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( size ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( size );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', size );\n\n\tthis._outerTickSize = size;\n\tdebug( 'New Value: %s.', this._outerTickSize );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/tick_padding.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:tickpadding' );\nvar CHANGE_EVENT = events( 'tickPadding' );\n\n\n// MAIN //\n\n/**\n* Sets the axis tick padding.\n*\n* @private\n* @param {NonNegativeInteger} padding - padding\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( padding ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( padding );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', padding );\n\n\tthis._tickPadding = padding;\n\tdebug( 'New Value: %s.', this._tickPadding );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:center' );\n\n\n// MAIN //\n\n/**\n* Returns a function to center a tick.\n*\n* @private\n* @returns {Function} function to center a tick\n*/\nfunction center() {\n\t/* eslint-disable no-invalid-this */\n\tvar width = this._scale.bandwidth() / 2;\n\treturn center;\n\n\t/**\n\t* Returns a centered tick position.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {number} tick position\n\t*/\n\tfunction center( d ) {\n\t\tvar pos = this._scale( d ) + width;\n\t\tdebug( 'Value: %s => Coordinate: %d', d, pos );\n\t\treturn pos;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default center;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport events from './../../events';\nimport isValid from './../../validators/auto_render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:set:auto-render' );\nvar CHANGE_EVENT = events( 'autoRender' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tvar err = isValid( bool );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( CHANGE_EVENT );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* For manually constructing SVG paths, see [MDN]{@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d}\n*/\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:domain' );\nvar ELEMENT = 'path';\n\n\n// MAIN //\n\n/**\n* Renders an axis domain.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar orient;\n\tvar stroke;\n\tvar range0;\n\tvar range1;\n\tvar offset;\n\tvar range;\n\tvar props;\n\tvar d;\n\n\torient = ctx._orientation;\n\tdebug( 'Axis orientation: %s.', orient );\n\n\trange = ctx._scale.range();\n\tdebug( 'Axis range: %s.', JSON.stringify( range ) );\n\n\trange0 = range[ 0 ] + 0.5;\n\trange1 = range[ range.length-1 ] + 0.5;\n\n\toffset = ctx.tickDir * ctx._outerTickSize;\n\td = '';\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\td += 'M' + offset + ',' + range0;\n\t\td += 'H0.5';\n\t\td += 'V' + range1;\n\t\td += 'H' + offset;\n\n\t\tstroke = 'none';\n\t} else {\n\t\td += 'M' + range0 + ',' + offset;\n\t\td += 'V0.5';\n\t\td += 'H' + range1;\n\t\td += 'V' + offset;\n\n\t\tstroke = '#aaa';\n\t}\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'axis.domain',\n\t\t'className': 'domain',\n\t\t'attributes': {\n\t\t\t'fill': 'none',\n\t\t\t'stroke': stroke,\n\t\t\t'stroke-width': 1,\n\t\t\t'd': d\n\t\t}\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, [] );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:engine:translate-x' );\n\n\n// MAIN //\n\n/**\n* Returns a function to horizontally translate a tick.\n*\n* @private\n* @param {Function} scale - scale function\n* @returns {Function} function to translate a tick\n*/\nfunction translateX( scale ) {\n\treturn translateX;\n\n\t/**\n\t* Horizontally translates a tick.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {string} transform\n\t*/\n\tfunction translateX( d ) {\n\t\tvar t = 'translate('+scale( d )+',0)';\n\t\tdebug( 'Value: %s => Transform: %s.', d, t );\n\t\treturn t;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default translateX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:engine:translate-y' );\n\n\n// MAIN //\n\n/**\n* Returns a function to vertically translate a tick.\n*\n* @private\n* @param {Function} scale - scale function\n* @returns {Function} function to translate a tick\n*/\nfunction translateY( scale ) {\n\treturn translateY;\n\n\t/**\n\t* Vertically translates a tick.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {string} transform\n\t*/\n\tfunction translateY( d ) {\n\t\tvar t = 'translate(0,'+scale( d )+')';\n\t\tdebug( 'Value: %s => Transform: %s.', d, t );\n\t\treturn t;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default translateY;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport translateX from './translate_x.js';\nimport translateY from './translate_y.js';\n\n\n// MAIN //\n\n/**\n* Returns a function to translate ticks.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {Function} scale - scale function\n* @returns {Function} transform function\n*/\nfunction tickTransform( orient, scale ) {\n\tif ( orient === 'top' || orient === 'bottom' ) {\n\t\treturn translateX( scale );\n\t}\n\treturn translateY( scale );\n}\n\n\n// EXPORTS //\n\nexport default tickTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the \"x\" attribute for tick positioning.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {string} attribute\n*/\nfunction xAttr( orient ) {\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\treturn 'x';\n\t}\n\treturn 'y';\n}\n\n\n// EXPORTS //\n\nexport default xAttr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the \"y\" attribute for tick positioning.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {string} attribute\n*/\nfunction yAttr( orient ) {\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\treturn 'y';\n\t}\n\treturn 'x';\n}\n\n\n// EXPORTS //\n\nexport default yAttr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport xAttr from './../utils/x_attr.js';\nimport yAttr from './../utils/y_attr.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:line' );\nvar ELEMENT = 'line';\n\n\n// MAIN //\n\n/**\n* Renders a tick line.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar props;\n\tvar x;\n\tvar y;\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'attributes': {\n\t\t\t'stroke': '#aaa',\n\t\t\t'stroke-width': 1\n\t\t}\n\t};\n\n\tx = xAttr( ctx._orientation );\n\ty = yAttr( ctx._orientation );\n\n\tprops.attributes[ x+'2' ] = ctx.tickDir * ctx._innerTickSize;\n\tprops.attributes[ y+'1' ] = 0.5;\n\tprops.attributes[ y+'2' ] = 0.5;\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, [] );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns vertical shift for aligning tick text.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {string} text shift\n*/\nfunction dy( orient ) {\n\tif ( orient === 'top' ) {\n\t\treturn '0em';\n\t}\n\tif ( orient === 'bottom' ) {\n\t\treturn '.71em';\n\t}\n\treturn '.32em';\n}\n\n\n// EXPORTS //\n\nexport default dy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport dy from './../utils/text_dy.js';\nimport xAttr from './../utils/x_attr.js';\nimport yAttr from './../utils/y_attr.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:text' );\nvar ELEMENT = 'text';\n\n\n// MAIN //\n\n/**\n* Renders tick text.\n*\n* @private\n* @param {Object} ctx - context\n* @param {*} d - tick value\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx, d ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar orient;\n\tvar props;\n\tvar txt;\n\tvar x;\n\tvar y;\n\n\torient = ctx._orientation;\n\tdebug( 'Axis orientation: %s.', orient );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'attributes': {\n\t\t\t'fill': '#000',\n\t\t\t'dy': dy( orient )\n\t\t}\n\t};\n\n\tx = xAttr( orient );\n\ty = yAttr( orient );\n\n\tprops.attributes[ x ] = ctx.tickDir * ctx.tickSpacing;\n\tprops.attributes[ y ] = 0.5;\n\n\ttxt = ctx.tickFormat( d );\n\tdebug( 'Tick text: %s.', txt );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, txt );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport line from './line.js';\nimport text from './text.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:tick' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders an axis tick.\n*\n* @private\n* @param {Object} ctx - context\n* @param {*} d - tick value\n* @param {Function} transform - tick transform\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx, d, transform ) {\n\tvar children;\n\tvar props;\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'axis.tick',\n\t\t'className': 'tick',\n\t\t'attributes': {\n\t\t\t'opacity': 1,\n\t\t\t'transform': transform( d )\n\t\t}\n\t};\n\tchildren = new Array( 2 );\n\n\tdebug( 'Rendering a tick line...' );\n\tchildren[ 0 ] = line( ctx );\n\n\tdebug( 'Rendering tick text...' );\n\tchildren[ 1 ] = text( ctx, d );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, children );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport tickTransform from './../utils/tick_transform.js';\nimport tick from './tick.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:ticks' );\n\n\n// MAIN //\n\n/**\n* Renders axis ticks.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {Array} array of virtual DOM trees\n*/\nfunction render( ctx ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar transform;\n\tvar values;\n\tvar out;\n\tvar i;\n\n\tvalues = ctx.ticks;\n\tdebug( 'Tick values: %s.', JSON.stringify( values ) );\n\n\tdebug( 'Generating tick transform...' );\n\ttransform = tickTransform( ctx._orientation, ctx._scale );\n\n\tdebug( 'Rendering ticks...' );\n\tout = new Array( values.length );\n\tfor ( i = 0; i < values.length; i++ ) {\n\t\tdebug( 'Rendering tick %d with value %s...', i, values[i] );\n\t\tout[ i ] = tick( ctx, values[i], transform );\n\t}\n\tdebug( 'Finished rendering ticks.' );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a label SVG transform.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {string} SVG transform\n*/\nfunction labelTransform( orient ) {\n\tif ( orient === 'bottom' || orient === 'top' ) {\n\t\treturn 'rotate(0)';\n\t}\n\tif ( orient === 'left' ) {\n\t\treturn 'rotate(-90)';\n\t}\n\t// orient === 'right'\n\treturn 'rotate(90)';\n}\n\n\n// EXPORTS //\n\nexport default labelTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the label `x` coordinate.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {NumericArray} range - scale range\n* @returns {number} `x` coordinate\n*/\nfunction labelXPos( orient, range ) {\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\treturn -range[0] / 2;\n\t}\n\treturn range[1] / 2;\n}\n\n\n// EXPORTS //\n\nexport default labelXPos;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the label `y` coordinate.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {number} `y` coordinate\n*/\nfunction labelYPos( orient ) {\n\tif ( orient === 'left' ) {\n\t\treturn -72;\n\t}\n\tif ( orient === 'right' ) {\n\t\treturn 72;\n\t}\n\tif ( orient === 'bottom' ) {\n\t\treturn 45;\n\t}\n\t// orient === 'top'\n\treturn -45;\n}\n\n\n// EXPORTS //\n\nexport default labelYPos;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport labelTransform from './../utils/label_transform.js';\nimport labelXPos from './../utils/label_x_pos.js';\nimport labelYPos from './../utils/label_y_pos.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:label' );\nvar ELEMENT = 'text';\n\n\n// MAIN //\n\n/**\n* Renders an axis label.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar orient;\n\tvar props;\n\n\torient = ctx._orientation;\n\tdebug( 'Axis orientation: %s.', orient );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'axis.label',\n\t\t'className': 'label noselect',\n\t\t'attributes': {\n\t\t\t'fill': '#000',\n\t\t\t'stroke': 'none',\n\t\t\t'text-anchor': 'middle',\n\t\t\t'transform': labelTransform( orient ),\n\t\t\t'x': labelXPos( orient, ctx._scale.range() ),\n\t\t\t'y': labelYPos( orient )\n\t\t}\n\t};\n\n\tdebug( 'Axis label: %s.', ctx._label );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, ctx._label );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport textAnchor from './../utils/text_anchor.js';\nimport domain from './domain.js';\nimport ticks from './ticks.js';\nimport label from './label.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:components:main' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders an axis.\n*\n* @private\n* @param {Object} ctx - context\n* @returns {VTree} virtual tree\n*/\nfunction render( ctx ) {\n\tvar children;\n\tvar props;\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'axis',\n\t\t'className': 'axis',\n\t\t'attributes': {\n\t\t\t'fill': 'none',\n\t\t\t'font-size': 10, // TODO: option\n\t\t\t'font-family': 'sans-serif', // TODO: option\n\t\t\t'text-anchor': textAnchor( ctx._orientation ) // eslint-disable-line no-underscore-dangle\n\t\t}\n\t};\n\n\tdebug( 'Rendering tick marks...' );\n\tchildren = ticks( ctx );\n\n\tdebug( 'Rendering domain line...' );\n\tchildren.unshift( domain( ctx ) );\n\n\tdebug( 'Rendering label...' );\n\tchildren.push( label( ctx ) );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\n\treturn h( ELEMENT, props, children );\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the text anchor value for text positioning.\n*\n* @private\n* @param {string} orient - axis orientation\n* @returns {string} text anchor value\n*/\nfunction textAnchor( orient ) {\n\tif ( orient === 'left' ) {\n\t\treturn 'end';\n\t}\n\tif ( orient === 'right' ) {\n\t\treturn 'start';\n\t}\n\treturn 'middle';\n}\n\n\n// EXPORTS //\n\nexport default textAnchor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport components from './../components';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:render' );\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\tvtree = components( this );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: improve JSDoc examples\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport copy from '@stdlib/utils/copy';\nimport defaults from './defaults.json';\nimport validate from './validate.js';\nimport setScale from './props/scale/set.js';\nimport getScale from './props/scale/get.js';\nimport setOrientation from './props/orientation/set.js';\nimport getOrientation from './props/orientation/get.js';\nimport setLabel from './props/label/set.js';\nimport getLabel from './props/label/get.js';\nimport setTicks from './props/ticks/set.js';\nimport getTicks from './props/ticks/get.js';\nimport setNumTicks from './props/num-ticks/set.js';\nimport getNumTicks from './props/num-ticks/get.js';\nimport setTickFormat from './props/tick-format/set.js';\nimport getTickFormat from './props/tick-format/get.js';\nimport setTickSize from './props/tick-size/set.js';\nimport getTickSize from './props/tick-size/get.js';\nimport setInnerTickSize from './props/inner-tick-size/set.js';\nimport getInnerTickSize from './props/inner-tick-size/get.js';\nimport setOuterTickSize from './props/outer-tick-size/set.js';\nimport getOuterTickSize from './props/outer-tick-size/get.js';\nimport setTickPadding from './props/tick-padding/set.js';\nimport getTickPadding from './props/tick-padding/get.js';\nimport getTickSpacing from './props/tick-spacing/get.js';\nimport getTickDir from './props/tick-dir/get.js';\nimport getTickPos from './props/tick-pos/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport render from './methods/render.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'axis:main' );\n\n\n// MAIN //\n\n/**\n* Axis constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {Function} [options.scale] - scale function\n* @param {string} [options.orientation='bottom'] - axis orientation\n* @param {string} [options.label] - axis label\n* @param {(Array|null)} [options.ticks] - tick values\n* @param {(NonNegativeInteger|null)} [options.numTicks] - number of ticks\n* @param {(null|string|Function)} [options.tickFormat] - tick format\n* @param {NonNegativeInteger} [options.tickSize=6] - tick size\n* @param {NonNegativeInteger} [options.innerTickSize=6] - inner tick size\n* @param {NonNegativeInteger} [options.outerTickSize=6] - outer tick size\n* @param {NonNegativeInteger} [options.tickPadding=3] - tick padding\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Axis} axis instance\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom'\n* });\n*/\nfunction Axis( options ) {\n\tvar self;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof Axis ) ) {\n\t\treturn new Axis( options );\n\t}\n\tself = this;\n\topts = copy( defaults );\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tdefineProperty( this, '_scale', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.scale || linear()\n\t});\n\tdefineProperty( this, '_orientation', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.orientation\n\t});\n\tdefineProperty( this, '_label', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.label\n\t});\n\tdefineProperty( this, '_ticks', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.ticks\n\t});\n\tdefineProperty( this, '_numTicks', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.numTicks\n\t});\n\tdefineProperty( this, '_tickFormat', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.tickFormat\n\t});\n\tdefineProperty( this, '_tickSize', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.tickSize\n\t});\n\tdefineProperty( this, '_innerTickSize', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.innerTickSize\n\t});\n\tdefineProperty( this, '_outerTickSize', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.outerTickSize\n\t});\n\tdefineProperty( this, '_tickPadding', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.tickPadding\n\t});\n\tdefineProperty( this, '_autoRender', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': opts.autoRender\n\t});\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nAxis.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nAxis.prototype.constructor = Axis;\n\n/**\n* Scale function.\n*\n* @name scale\n* @memberof Axis.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'top'\n* });\n*\n* var f = axis.scale;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'scale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setScale,\n\t'get': getScale\n});\n\n/**\n* Axis orientation.\n*\n* @name orientation\n* @memberof Axis.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default 'bottom'\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom'\n* });\n* axis.orientation = 'top';\n*\n* var v = axis.orientation;\n* // returns 'top'\n*/\ndefineProperty( Axis.prototype, 'orientation', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOrientation,\n\t'get': getOrientation\n});\n\n/**\n* Axis label.\n*\n* @name label\n* @memberof Axis.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var axis = new Axis({\n* 'label': 'y'\n* });\n* axis.label = 'Counts';\n*\n* var v = axis.label;\n* // returns 'Counts'\n*/\ndefineProperty( Axis.prototype, 'label', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLabel,\n\t'get': getLabel\n});\n\n/**\n* Axis tick values. When set to `null`, the retrieved values are the computed tick values.\n*\n* @name ticks\n* @memberof Axis.prototype\n* @type {(Array|null)}\n* @throws {TypeError} must be an array or null\n* @default null\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'ticks': [1,2,3]\n* });\n* axis.ticks = ['a','b','c'];\n*\n* var v = axis.ticks;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'ticks', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTicks,\n\t'get': getTicks\n});\n\n/**\n* Number of axis ticks.\n*\n* @name numTicks\n* @memberof Axis.prototype\n* @type {(NonNegativeInteger|null)}\n* @throws {TypeError} must be a nonnegative integer or null\n* @default null\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'numTicks': 10\n* });\n* axis.numTicks = 5;\n*\n* var v = axis.numTicks;\n* // returns 5\n*/\ndefineProperty( Axis.prototype, 'numTicks', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setNumTicks,\n\t'get': getNumTicks\n});\n\n/**\n* Tick format. When retrieved, the returned value is a formatting function.\n*\n* @name tickFormat\n* @memberof Axis.prototype\n* @type {(null|string|Function)}\n* @throws {TypeError} must be either null, a string, or a function\n* @default null\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'tickFormat': ',f'\n* });\n* axis.tickFormat = ',.0f';\n*\n* var v = axis.tickFormat;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'tickFormat', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTickFormat,\n\t'get': getTickFormat\n});\n\n/**\n* Axis tick size.\n*\n* @name tickSize\n* @memberof Axis.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 6\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'tickSize': 12\n* });\n* axis.tickSize = 8;\n*\n* var v = axis.tickSize;\n* // returns 8\n*/\ndefineProperty( Axis.prototype, 'tickSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTickSize,\n\t'get': getTickSize\n});\n\n/**\n* Axis inner tick size.\n*\n* @name innerTickSize\n* @memberof Axis.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 6\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'innerTickSize': 10\n* });\n* axis.innerTickSize = 5;\n*\n* var v = axis.innerTickSize;\n* // returns 5\n*/\ndefineProperty( Axis.prototype, 'innerTickSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setInnerTickSize,\n\t'get': getInnerTickSize\n});\n\n/**\n* Axis outer tick size.\n*\n* @name outerTickSize\n* @memberof Axis.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 6\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'outerTickSize': 10\n* });\n* axis.outerTickSize = 5;\n*\n* var v = axis.outerTickSize;\n* // returns 5\n*/\ndefineProperty( Axis.prototype, 'outerTickSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOuterTickSize,\n\t'get': getOuterTickSize\n});\n\n/**\n* Axis tick padding.\n*\n* @name tickPadding\n* @memberof Axis.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 3\n*\n* @example\n* var axis = new Axis({\n* 'orientation': 'bottom',\n* 'tickPadding': 10\n* });\n* axis.tickPadding = 5;\n*\n* var v = axis.tickPadding;\n* // returns 5\n*/\ndefineProperty( Axis.prototype, 'tickPadding', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTickPadding,\n\t'get': getTickPadding\n});\n\n/**\n* Tick spacing.\n*\n* @name tickSpacing\n* @memberof Axis.prototype\n* @type {number}\n*\n* @example\n* var axis = new Axis( {} );\n*\n* var spacing = axis.tickSpacing;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'tickSpacing', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getTickSpacing\n});\n\n/**\n* Tick direction.\n*\n* @name tickDir\n* @memberof Axis.prototype\n* @type {number}\n*\n* @example\n* var axis = new Axis( {} );\n*\n* var dir = axis.tickDir;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'tickDir', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getTickDir\n});\n\n/**\n* Function for computing tick positions.\n*\n* @name tickPos\n* @memberof Axis.prototype\n* @type {Function}\n*\n* @example\n* var axis = new Axis( {} );\n*\n* var tickPos = axis.tickPos;\n* // returns \n*/\ndefineProperty( Axis.prototype, 'tickPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getTickPos\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Axis.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var axis = new Axis({\n* 'autoRender': true\n* });\n*\n* var mode = axis.autoRender;\n* // returns true\n*/\ndefineProperty( Axis.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Axis.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var axis = new Axis( {} );\n*\n* var out = axis.render();\n*/\nsetReadOnly( Axis.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Axis;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._scale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the axis orientation.\n*\n* @private\n* @returns {string} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._orientation;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the axis label.\n*\n* @private\n* @returns {string} label\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._label;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\n\n\n// MAIN //\n\n/**\n* Returns the axis tick values.\n*\n* @private\n* @returns {Array} ticks\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tif ( isNull( this._ticks ) ) {\n\t\tif ( this._scale.ticks ) {\n\t\t\treturn this._scale.ticks( this._numTicks, this._tickFormat );\n\t\t}\n\t\treturn this._scale.domain();\n\t}\n\treturn this._ticks.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the number of axis ticks.\n*\n* @private\n* @returns {(NonNegativeInteger|null)} number of ticks\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._numTicks;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the axis tick size.\n*\n* @private\n* @returns {NonNegativeInteger} tick size\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._tickSize;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the inner tick size.\n*\n* @private\n* @returns {NonNegativeInteger} tick size\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._innerTickSize;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the axis outer tick size.\n*\n* @private\n* @returns {NonNegativeInteger} tick size\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._outerTickSize;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the axis tick padding.\n*\n* @private\n* @returns {NonNegativeInteger} padding\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._tickPadding;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the tick spacing.\n*\n* @private\n* @returns {number} tick spacing\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._innerTickSize + this._tickPadding;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the tick direction.\n*\n* @private\n* @returns {number} tick direction\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\tthis._orientation === 'top' ||\n\t\tthis._orientation === 'left'\n\t) {\n\t\treturn -1;\n\t}\n\treturn 1;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport center from './center.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for positioning ticks.\n*\n* @private\n* @returns {Function} position function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this._scale.copy();\n\tif ( scale.bandwidth ) {\n\t\treturn center( scale );\n\t}\n\treturn scale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isnan } from '@stdlib/assert/is-nan';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:accessor:is-defined' );\n\n\n// MAIN //\n\n/**\n* Accessor function which determines whether a datum is defined.\n*\n* @private\n* @param {number} d - datum\n* @returns {boolean} boolean indicating whether a datum is defined\n*/\nfunction isDefined( d ) {\n\tvar bool = !isnan( d );\n\tdebug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool );\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isDefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArrayLike from '@stdlib/assert/is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:x' );\n\n\n// MAIN //\n\n/**\n* Sets the `x` values.\n*\n* @private\n* @param {ArrayLike} x - x values\n* @throws {TypeError} must be array-like\n*/\nfunction set( x ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'x', x ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xData ) );\n\n\tthis._xData = x;\n\tdebug( 'New Value: %s.', JSON.stringify( this._xData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArrayLike from '@stdlib/assert/is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:y' );\n\n\n// MAIN //\n\n/**\n* Sets the `y` values.\n*\n* @private\n* @param {ArrayLike} y - y values\n* @throws {TypeError} must be array-like\n*/\nfunction set( y ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArrayLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'y', y ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yData ) );\n\n\tthis._yData = y;\n\tdebug( 'New Value: %s.', JSON.stringify( this._yData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:xscale' );\n\n\n// MAIN //\n\n/**\n* Sets the x-scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xScale', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._xScale );\n\n\tthis._xScale = fcn;\n\tdebug( 'New Value: %s.', this._xScale );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:yscale' );\n\n\n// MAIN //\n\n/**\n* Sets the y-scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yScale', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._yScale );\n\n\tthis._yScale = fcn;\n\tdebug( 'New Value: %s.', this._yScale );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:is-defined' );\n\n\n// MAIN //\n\n/**\n* Sets the accessor for defined values.\n*\n* @private\n* @param {Function} fcn - accessor\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._isDefined );\n\n\tthis._isDefined = fcn;\n\tdebug( 'New Value: %s.', this._isDefined );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:color' );\n\n\n// MAIN //\n\n/**\n* Sets the path color.\n*\n* @private\n* @param {string} color - color\n* @throws {TypeError} must be a string\n*/\nfunction set( color ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( color ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'color', color ) );\n\t}\n\tdebug( 'Current value: %d.', this._color );\n\n\tthis._color = color;\n\tdebug( 'New Value: %d.', this._color );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:label' );\n\n\n// MAIN //\n\n/**\n* Sets the path label.\n*\n* @private\n* @param {string} label - label\n* @throws {TypeError} must be a string\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( label ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'label', label ) );\n\t}\n\tdebug( 'Current value: %d.', this._label );\n\n\tthis._label = label;\n\tdebug( 'New Value: %d.', this._label );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the opacity.\n*\n* @private\n* @param {number} opacity - opacity\n* @throws {TypeError} must be a number\n* @throws {RangeError} must be a number on the interval `[0,1]`\n*/\nfunction set( opacity ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNumber( opacity ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', 'opacity', opacity ) );\n\t}\n\tif (\n\t\topacity < 0.0 ||\n\t\topacity > 1.0\n\t) {\n\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) );\n\t}\n\tdebug( 'Current value: %d.', this._opacity );\n\n\tthis._opacity = opacity;\n\tdebug( 'New Value: %d.', this._opacity );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:width' );\n\n\n// MAIN //\n\n/**\n* Sets the width.\n*\n* @private\n* @param {NonNegativeInteger} v - width\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'width', v ) );\n\t}\n\tdebug( 'Current value: %d.', this._width );\n\n\tthis._width = v;\n\tdebug( 'New Value: %d.', this._width );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:style' );\n\n\n// MAIN //\n\n/**\n* Sets the path style.\n*\n* @private\n* @param {string} v - style\n* @throws {TypeError} must be a string\n*/\nfunction set( v ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( v ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'style', v ) );\n\t}\n\tdebug( 'Current value: %d.', this._style );\n\n\tthis._style = v;\n\tdebug( 'New Value: %d.', this._style );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:set:auto-render' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a positive number\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isBoolean( bool ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) );\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n","export default function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n","export var slice = Array.prototype.slice;\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","import none from \"./none.js\";\n\nexport default function(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n","import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n","import constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n","import appearance from \"./appearance.js\";\nimport {sum} from \"./ascending.js\";\n\nexport default function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n","import none from \"./none.js\";\n\nexport default function(series) {\n return none(series).reverse();\n}\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar line = require( 'd3-shape' ).line; // TODO: remove\n\n\n// MAIN //\n\n/**\n* Returns a function to generate a line as an SVG path.\n*\n* @private\n* @returns {Function} function to generate a line as an SVG path\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this, stdlib/empty-line-before-comment */\n\tvar f = line()\n\t\t.x( this.xPos )\n\t\t.y( this.yPos )\n\t\t.defined( this.isDefined );\n\t\t// TODO: interpolate (curve factory)\n\t\t// TODO: tension\n\n\treturn f;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:xpos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to x coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.xScale;\n\treturn xPos;\n\n\t/**\n\t* Maps a value to a x coordinate value.\n\t*\n\t* @private\n\t* @param {Array} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction xPos( d ) {\n\t\tvar px = scale( d[0] );\n\t\tdebug( 'Value: %d => Pixel: %d.', d[0], px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:ypos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to y coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.yScale;\n\treturn yPos;\n\n\t/**\n\t* Maps a value to a y coordinate value.\n\t*\n\t* @private\n\t* @param {Array} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction yPos( d ) {\n\t\tvar px = scale( d[1] );\n\t\tdebug( 'Value: %d => Pixel: %d.', d[1], px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Zips two arrays.\n*\n* @private\n* @param {ArrayLike} x - x-values\n* @param {ArrayLike} y - y-values\n* @throws {Error} must provide equal length array-like objects\n* @returns {Array} zipped array\n*/\nfunction zip( x, y ) {\n\tvar out;\n\tvar i;\n\tif ( x.length !== y.length ) {\n\t\tthrow new Error( format( 'invalid arguments. Must provide equal length array-like objects. x length: `%u`. y length: `%u`.', x.length, y.length ) );\n\t}\n\tout = new Array( x.length );\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tout[ i ] = [ x[i], y[i] ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default zip;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar STYLES = {\n\t// Solid path:\n\t'-': '',\n\n\t// Dashes:\n\t'--': '5, 1',\n\n\t// Dotted path:\n\t':': '0.9',\n\n\t// Dash-dotted path:\n\t'-.': '5, 1, 1, 1'\n};\n\n\n// MAIN //\n\n/**\n* Checks for a known style. If present, returns the [`stroke-dasharray`][1]. Otherwise, returns the provided input value.\n*\n* [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n*\n* @private\n* @param {string} v - style\n* @returns {string} stroke dasharray value\n*/\nfunction style( v ) {\n\tvar s = STYLES[ v ];\n\tif ( s ) {\n\t\treturn s;\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nexport default style;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport zip from './utils/zip.js';\nimport style from './utils/style.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:render' );\nvar ELEMENT = 'path';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'line',\n\t\t'className': 'path line',\n\t\t'attributes': {\n\t\t\t'd': this.line( zip( this._xData, this._yData ) ),\n\t\t\t'fill': 'none',\n\t\t\t'stroke': this.color,\n\t\t\t'stroke-width': this.width,\n\t\t\t'stroke-opacity': this.opacity,\n\t\t\t'stroke-dasharray': style( this.style ),\n\t\t\t'data-label': this.label\n\t\t}\n\t};\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, [] );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: improve JSDoc examples\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport objectKeys from '@stdlib/utils/keys';\nimport format from '@stdlib/string/format';\nimport copy from '@stdlib/utils/copy';\nimport merge from '@stdlib/utils/merge';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport isDefined from './accessors/is_defined.js';\nimport defaults from './defaults.json';\nimport setX from './props/x/set.js';\nimport getX from './props/x/get.js';\nimport setY from './props/y/set.js';\nimport getY from './props/y/get.js';\nimport setXScale from './props/x-scale/set.js';\nimport getXScale from './props/x-scale/get.js';\nimport setYScale from './props/y-scale/set.js';\nimport getYScale from './props/y-scale/get.js';\nimport setIsDefined from './props/is-defined/set.js';\nimport getIsDefined from './props/is-defined/get.js';\nimport setColor from './props/color/set.js';\nimport getColor from './props/color/get.js';\nimport setLabel from './props/label/set.js';\nimport getLabel from './props/label/get.js';\nimport setOpacity from './props/opacity/set.js';\nimport getOpacity from './props/opacity/get.js';\nimport setWidth from './props/width/set.js';\nimport getWidth from './props/width/get.js';\nimport setStyle from './props/style/set.js';\nimport getStyle from './props/style/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport getLine from './props/line/get.js';\nimport getXPos from './props/x-pos/get.js';\nimport getYPos from './props/y-pos/get.js';\nimport render from './render';\n\n\n// VARIABLES //\n\nvar debug = logger( 'path:main' );\nvar PRIVATE_PROPS = [\n\t'_autoRender',\n\t'_color',\n\t'_isDefined',\n\t'_label',\n\t'_opacity',\n\t'_style',\n\t'_width',\n\t'_xData',\n\t'_xScale',\n\t'_yData',\n\t'_yScale'\n];\n\n\n// MAIN //\n\n/**\n* Path constructor.\n*\n* @constructor\n* @param {Options} [options] - constructor options\n* @param {ArrayLike} [options.x=[]] - x-values\n* @param {ArrayLike} [options.y=[]] - y-values\n* @param {Function} [options.xScale] - x scale function\n* @param {Function} [options.yScale] - y scale function\n* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined\n* @param {string} [options.color] - color\n* @param {string} [options.label] - label\n* @param {NonNegativeInteger} [options.width=2] - width\n* @param {number} [options.opacity=0.9] - opacity\n* @param {string} [options.style='-'] - style\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Path} Path instance\n*\n* @example\n* var path = new Path({\n* 'x': [0.1,0.2,0.3],\n* 'y': [0.4,0.5,0.6]\n* });\n*/\nfunction Path( options ) {\n\tvar self;\n\tvar keys;\n\tvar opts;\n\tvar key;\n\tvar i;\n\tif ( !( this instanceof Path ) ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn new Path( options );\n\t\t}\n\t\treturn new Path();\n\t}\n\tself = this;\n\n\topts = copy( defaults );\n\topts.isDefined = isDefined;\n\topts.xScale = linear();\n\topts.yScale = linear();\n\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = merge( opts, options );\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tfor ( i = 0; i < PRIVATE_PROPS.length; i++ ) {\n\t\tdefineProperty( this, PRIVATE_PROPS[i], {\n\t\t\t'configurable': false,\n\t\t\t'enumerable': false,\n\t\t\t'writable': true,\n\t\t\t'value': null\n\t\t});\n\t}\n\t// Set options...\n\tkeys = objectKeys( opts );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tthis[ key ] = opts[ key ];\n\t}\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nPath.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nPath.prototype.constructor = Path;\n\n/**\n* `x` values.\n*\n* @name x\n* @memberof Path.prototype\n* @type {ArrayLike}\n* @throws {TypeError} must be array-like\n* @default []\n*\n* @example\n* var path = new Path({\n* 'x': [0.1,0.2,0.3]\n* });\n*\n* var x = path.x;\n* // returns [0.1,0.2,0.3]\n*/\ndefineProperty( Path.prototype, 'x', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setX,\n\t'get': getX\n});\n\n/**\n* `y` values.\n*\n* @name y\n* @memberof Path.prototype\n* @type {ArrayLike}\n* @throws {TypeError} must be array-like\n* @default []\n*\n* @example\n* var path = new Path({\n* 'y': [0.4,0.5,0.6]\n* });\n*\n* var y = path.y;\n* // returns [0.4,0.5,0.6]\n*/\ndefineProperty( Path.prototype, 'y', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setY,\n\t'get': getY\n});\n\n/**\n* `x` scale function.\n*\n* @name xScale\n* @memberof Path.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var path = new Path({\n* 'xScale': function scale(){}\n* });\n*\n* var f = path.xScale;\n* // returns \n*/\ndefineProperty( Path.prototype, 'xScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXScale,\n\t'get': getXScale\n});\n\n/**\n* `y` scale function.\n*\n* @name yScale\n* @memberof Path.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var path = new Path({\n* 'yScale': function scale(){}\n* });\n*\n* var f = path.yScale;\n* // returns \n*/\ndefineProperty( Path.prototype, 'yScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYScale,\n\t'get': getYScale\n});\n\n/**\n* Accessor which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`.\n*\n* @name isDefined\n* @memberof Path.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var path = new Path();\n* path.isDefined = function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n*\n* @example\n* function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n* var path = new Path({\n* 'isDefined': isDefined\n* });\n* var fcn = path.isDefined;\n* // returns \n*/\ndefineProperty( Path.prototype, 'isDefined', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setIsDefined,\n\t'get': getIsDefined\n});\n\n/**\n* Path color.\n*\n* @name color\n* @memberof Path.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var path = new Path({\n* 'color': 'steelblue'\n* });\n*\n* var color = path.color;\n* // returns 'steelblue'\n*/\ndefineProperty( Path.prototype, 'color', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setColor,\n\t'get': getColor\n});\n\n/**\n* Path label.\n*\n* @name label\n* @memberof Path.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n*\n* @example\n* var path = new Path({\n* 'label': 'line-1'\n* });\n*\n* var label = path.label;\n* // returns 'line-1'\n*/\ndefineProperty( Path.prototype, 'label', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLabel,\n\t'get': getLabel\n});\n\n/**\n* Path opacity.\n*\n* @name opacity\n* @memberof Path.prototype\n* @type {number}\n* @throws {TypeError} must be a number\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.9\n*\n* @example\n* var path = new Path({\n* 'opacity': 0.5\n* });\n*\n* var opacity = path.opacity;\n* // returns 0.5\n*/\ndefineProperty( Path.prototype, 'opacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOpacity,\n\t'get': getOpacity\n});\n\n/**\n* Path width.\n*\n* @name width\n* @memberof Path.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 2\n*\n* @example\n* var path = new Path({\n* 'width': 1\n* });\n*\n* var width = path.width;\n* // returns 1\n*/\ndefineProperty( Path.prototype, 'width', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setWidth,\n\t'get': getWidth\n});\n\n/**\n* Path style.\n*\n* @name style\n* @memberof Path.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default '-'\n*\n* @example\n* var path = new Path({\n* 'style': '-.'\n* });\n*\n* var style = path.style;\n* // returns '-.'\n*/\ndefineProperty( Path.prototype, 'style', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setStyle,\n\t'get': getStyle\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Path.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var path = new Path({\n* 'autoRender': true\n* });\n*\n* var mode = path.autoRender;\n* // returns true\n*/\ndefineProperty( Path.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Returns a function to generate a line as an SVG path.\n*\n* @name line\n* @memberof Path.prototype\n* @type {Function}\n*\n* @example\n* var path = new Path();\n*\n* var line = path.line;\n* // returns \n*/\ndefineProperty( Path.prototype, 'line', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getLine\n});\n\n/**\n* Function to map values to x coordinate values.\n*\n* @name xPos\n* @memberof Path.prototype\n* @type {Function}\n*\n* @example\n* var path = new Path();\n* var xPos = path.xPos;\n* // returns \n*/\ndefineProperty( Path.prototype, 'xPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getXPos\n});\n\n/**\n* Function to map values to y coordinate values.\n*\n* @name yPos\n* @memberof Path.prototype\n* @type {Function}\n*\n* @example\n* var path = new Path();\n* var yPos = path.yPos;\n* // returns \n*/\ndefineProperty( Path.prototype, 'yPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getYPos\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Path.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var path = new Path();\n*\n* var out = path.render();\n*/\nsetReadOnly( Path.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Path;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the `x` values.\n*\n* @private\n* @returns {ArrayLike} x values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xData;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the `y` values.\n*\n* @private\n* @returns {ArrayLike} y values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yData;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xScale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yScale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the accessor for defined values.\n*\n* @private\n* @returns {Function} accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._isDefined;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the path color.\n*\n* @private\n* @returns {string} color\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._color;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the path label.\n*\n* @private\n* @returns {string} label\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._label;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the opacity.\n*\n* @private\n* @returns {number} opacity\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._opacity;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the width.\n*\n* @private\n* @returns {NonNegativeInteger} width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the path style.\n*\n* @private\n* @returns {string} style\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._style;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isnan } from '@stdlib/assert/is-nan';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:accessor:is-defined' );\n\n\n// MAIN //\n\n/**\n* Accessor function which determines whether a datum is defined.\n*\n* @private\n* @param {number} d - datum\n* @returns {boolean} boolean indicating whether a datum is defined\n*/\nfunction isDefined( d ) {\n\tvar bool = !isnan( d );\n\tdebug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool );\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isDefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport SYMBOLS from './symbols.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:symbol' );\n\n\n// MAIN //\n\n/**\n* Sets the symbol.\n*\n* @private\n* @param {string} symbol - symbol\n* @throws {TypeError} must be a supported symbol\n*/\nfunction set( symbol ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( SYMBOLS, symbol ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a supported symbol. Symbols: \"%s\". Value: `%s`.', 'symbol', SYMBOLS.join( '\", \"' ), symbol ) );\n\t}\n\tdebug( 'Current value: %d.', this._symbol );\n\n\tthis._symbol = symbol;\n\tdebug( 'New Value: %d.', this._symbol );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArrayLike from '@stdlib/assert/is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:x' );\n\n\n// MAIN //\n\n/**\n* Sets the `x` values.\n*\n* @private\n* @param {ArrayLike} x - x values\n* @throws {TypeError} must be array-like\n*/\nfunction set( x ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'x', x ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._xData ) );\n\n\tthis._xData = x;\n\tdebug( 'New Value: %s.', JSON.stringify( this._xData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArrayLike from '@stdlib/assert/is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:y' );\n\n\n// MAIN //\n\n/**\n* Sets the `y` values.\n*\n* @private\n* @param {ArrayLike} y - y values\n* @throws {TypeError} must be array-like\n*/\nfunction set( y ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArrayLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'y', y ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._yData ) );\n\n\tthis._yData = y;\n\tdebug( 'New Value: %s.', JSON.stringify( this._yData ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:xscale' );\n\n\n// MAIN //\n\n/**\n* Sets the x-scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xScale', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._xScale );\n\n\tthis._xScale = fcn;\n\tdebug( 'New Value: %s.', this._xScale );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:yscale' );\n\n\n// MAIN //\n\n/**\n* Sets the y-scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yScale', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._yScale );\n\n\tthis._yScale = fcn;\n\tdebug( 'New Value: %s.', this._yScale );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:is-defined' );\n\n\n// MAIN //\n\n/**\n* Sets the accessor for defined values.\n*\n* @private\n* @param {Function} fcn - accessor\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) );\n\t}\n\tdebug( 'Current value: %s.', this._isDefined );\n\n\tthis._isDefined = fcn;\n\tdebug( 'New Value: %s.', this._isDefined );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:size' );\n\n\n// MAIN //\n\n/**\n* Sets the symbol size.\n*\n* @private\n* @param {(NonNegativeInteger|Function)} size - size\n* @throws {TypeError} must be a nonnegative integer or a function\n*/\nfunction set( size ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isNonNegativeInteger( size ) &&\n\t\t!isFunction( size )\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer or a function. Value: `%s`.', 'size', size ) );\n\t}\n\tdebug( 'Current value: %d.', this._size );\n\n\tthis._size = size;\n\tdebug( 'New Value: %d.', this._size );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the symbol opacity.\n*\n* @private\n* @param {(number|Function)} opacity - opacity\n* @throws {TypeError} must be a number or a function\n* @throws {RangeError} must be a number on the interval `[0,1]`\n*/\nfunction set( opacity ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( opacity );\n\tif (\n\t\t!isNum &&\n\t\t!isFunction( opacity )\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or a function. Value: `%s`.', 'opacity', opacity ) );\n\t}\n\tif (\n\t\tisNum &&\n\t\t(opacity < 0.0 || opacity > 1.0)\n\t) {\n\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) );\n\t}\n\tdebug( 'Current value: %d.', this._opacity );\n\n\tthis._opacity = opacity;\n\tdebug( 'New Value: %d.', this._opacity );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:color' );\n\n\n// MAIN //\n\n/**\n* Sets the color.\n*\n* @private\n* @param {(string|Function)} color - color\n* @throws {TypeError} must be a string or function\n*/\nfunction set( color ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isString( color ) &&\n\t\t!isFunction( color )\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'color', color ) );\n\t}\n\tdebug( 'Current value: %d.', this._color );\n\n\tthis._color = color;\n\tdebug( 'New Value: %d.', this._color );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:label' );\n\n\n// MAIN //\n\n/**\n* Sets the label.\n*\n* @private\n* @param {(string|Function)} label - label\n* @throws {TypeError} must be a string or a function\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tif (\n\t\t!isString( label ) &&\n\t\t!isFunction( label )\n\t) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'label', label ) );\n\t}\n\tdebug( 'Current value: %d.', this._label );\n\n\tthis._label = label;\n\tdebug( 'New Value: %d.', this._label );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:set:auto-render' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a boolean\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isBoolean( bool ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) );\n\t}\n\tdebug( 'Current value: %d.', this._autoRender );\n\n\tthis._autoRender = bool;\n\tdebug( 'New Value: %d.', this._autoRender );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:xpos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to x coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.xScale;\n\n\treturn xPos;\n\t/**\n\t* Maps a value to a x coordinate value.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction xPos( d ) {\n\t\tvar px = scale( d );\n\t\tdebug( 'Value: %d => Pixel: %d.', d, px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:ypos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to y coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.yScale;\n\treturn yPos;\n\n\t/**\n\t* Maps a value to a y coordinate value.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction yPos( d ) {\n\t\tvar px = scale( d );\n\t\tdebug( 'Value: %d => Pixel: %d.', d, px );\n\t\treturn px;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:render:closed-circles' );\nvar ELEMENT = 'circle';\n\n\n// MAIN //\n\n/**\n* Renders data as a closed circles.\n*\n* @private\n* @param {Object} state - state\n* @returns {Array} array of virtual trees\n*/\nfunction render( state ) {\n\tvar isDefined;\n\tvar opacity;\n\tvar label;\n\tvar color;\n\tvar props;\n\tvar size;\n\tvar xPos;\n\tvar yPos;\n\tvar out;\n\tvar xi;\n\tvar yi;\n\tvar x;\n\tvar y;\n\tvar i;\n\n\tdebug( 'Rendering closed circles...' );\n\n\tisDefined = state.isDefined;\n\topacity = state.opacity;\n\tlabel = state.label;\n\tcolor = state.color;\n\tsize = state.size;\n\txPos = state.xPos;\n\tyPos = state.yPos;\n\tx = state.x;\n\ty = state.y;\n\n\tout = [];\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\txi = x[ i ];\n\t\tyi = y[ i ];\n\t\tif ( !isDefined( xi ) || !isDefined( yi ) ) {\n\t\t\tdebug( 'Datum %d is undefined. [%s,%s].', i, xi, yi );\n\t\t\tcontinue;\n\t\t}\n\t\tdebug( 'Rendering datum %d...', i );\n\t\tprops = {\n\t\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t\t'property': 'closed-circle',\n\t\t\t'className': 'closed-circle',\n\t\t\t'attributes': {\n\t\t\t\t'cx': xPos( xi ),\n\t\t\t\t'cy': yPos( yi ),\n\t\t\t\t'r': size( xi, yi, i ) / 2,\n\t\t\t\t'stroke': 'none',\n\t\t\t\t'opacity': opacity( xi, yi, i ),\n\t\t\t\t'fill': color( xi, yi, i ),\n\t\t\t\t'data-label': label( xi, yi, i )\n\t\t\t}\n\t\t};\n\t\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\t\tout.push( h( ELEMENT, props, [] ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:render:open-circles' );\nvar ELEMENT = 'circle';\n\n\n// MAIN //\n\n/**\n* Renders data as a open circles.\n*\n* @private\n* @param {Object} state - state\n* @returns {Array} array of virtual trees\n*/\nfunction render( state ) {\n\tvar isDefined;\n\tvar opacity;\n\tvar label;\n\tvar color;\n\tvar props;\n\tvar size;\n\tvar xPos;\n\tvar yPos;\n\tvar out;\n\tvar xi;\n\tvar yi;\n\tvar x;\n\tvar y;\n\tvar i;\n\n\tdebug( 'Rendering open circles...' );\n\n\tisDefined = state.isDefined;\n\topacity = state.opacity;\n\tlabel = state.label;\n\tcolor = state.color;\n\tsize = state.size;\n\txPos = state.xPos;\n\tyPos = state.yPos;\n\tx = state.x;\n\ty = state.y;\n\n\tout = new Array( x.length );\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\txi = x[ i ];\n\t\tyi = y[ i ];\n\t\tif ( !isDefined( xi ) || !isDefined( yi ) ) {\n\t\t\tdebug( 'Datum %d is undefined. [%s,%s].', i, xi, yi );\n\t\t\tcontinue;\n\t\t}\n\t\tdebug( 'Rendering datum %d...', i );\n\t\tprops = {\n\t\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t\t'property': 'open-circle',\n\t\t\t'className': 'open-circle',\n\t\t\t'attributes': {\n\t\t\t\t'cx': xPos( xi ),\n\t\t\t\t'cy': yPos( yi ),\n\t\t\t\t'r': size( xi, yi, i ) / 2,\n\t\t\t\t'fill': 'none',\n\t\t\t\t'opacity': opacity( xi, yi, i ),\n\t\t\t\t'stroke': color( xi, yi, i ),\n\t\t\t\t'stroke-width': 1, // TODO: make property? I certainly don't see a good reason or use case why this should be a function.\n\t\t\t\t'data-label': label( xi, yi, i )\n\t\t\t}\n\t\t};\n\t\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\t\tout[ i ] = h( ELEMENT, props, [] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport closedCircles from './closed_circles.js';\nimport openCircles from './open_circles.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:render' );\nvar ELEMENT = 'g';\nvar RENDER = {\n\t'closed-circle': closedCircles,\n\t'open-circle': openCircles\n};\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual DOM tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar children;\n\tvar props;\n\tvar vtree;\n\tvar f;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'symbols',\n\t\t'className': 'symbols'\n\t};\n\tdebug( 'Symbol: %s.', this.symbol );\n\n\tf = RENDER[ this.symbol ];\n\tchildren = f( this );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, children );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: improve JSDoc examples\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport objectKeys from '@stdlib/utils/keys';\nimport format from '@stdlib/string/format';\nimport copy from '@stdlib/utils/copy';\nimport merge from '@stdlib/utils/merge';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport isDefined from './accessors/is_defined.js';\nimport defaults from './defaults.json';\nimport setSymbol from './props/symbol/set.js';\nimport getSymbol from './props/symbol/get.js';\nimport setX from './props/x/set.js';\nimport getX from './props/x/get.js';\nimport setY from './props/y/set.js';\nimport getY from './props/y/get.js';\nimport setXScale from './props/x-scale/set.js';\nimport getXScale from './props/x-scale/get.js';\nimport setYScale from './props/y-scale/set.js';\nimport getYScale from './props/y-scale/get.js';\nimport setIsDefined from './props/is-defined/set.js';\nimport getIsDefined from './props/is-defined/get.js';\nimport setSize from './props/size/set.js';\nimport getSize from './props/size/get.js';\nimport setOpacity from './props/opacity/set.js';\nimport getOpacity from './props/opacity/get.js';\nimport setColor from './props/color/set.js';\nimport getColor from './props/color/get.js';\nimport setLabel from './props/label/set.js';\nimport getLabel from './props/label/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport getXPos from './props/x-pos/get.js';\nimport getYPos from './props/y-pos/get.js';\nimport render from './render';\n\n\n// VARIABLES //\n\nvar debug = logger( 'symbols:main' );\nvar PRIVATE_PROPS = [\n\t'_autoRender',\n\t'_color',\n\t'_isDefined',\n\t'_label',\n\t'_opacity',\n\t'_size',\n\t'_symbol',\n\t'_xData',\n\t'_xScale',\n\t'_yData',\n\t'_yScale'\n];\n\n\n// MAIN //\n\n/**\n* Symbols constructor.\n*\n* @constructor\n* @param {Options} options - constructor options\n* @param {ArrayLike} [options.x=[]] - x-values\n* @param {ArrayLike} [options.y=[]] - y-values\n* @param {Function} [options.xScale] - x scale function\n* @param {Function} [options.yScale] - y scale function\n* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined\n* @param {string} [options.symbol='closed-circle'] - symbol\n* @param {(number|Function)} [options.opacity=0.9] - opacity\n* @param {(string|Function)} [options.color] - color\n* @param {(string|Function)} [options.label] - label\n* @param {(NonNegativeInteger|Function)} [options.size=6] - symbol size\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @throws {TypeError} must provide valid options\n* @returns {Symbols} Symbols instance\n*\n* @example\n* var symbols = new Symbols({\n* 'x': [0.1,0.2,0.3],\n* 'y': [0.4,0.5,0.6]\n* });\n*/\nfunction Symbols( options ) {\n\tvar self;\n\tvar keys;\n\tvar opts;\n\tvar key;\n\tvar i;\n\tif ( !( this instanceof Symbols ) ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn new Symbols( options );\n\t\t}\n\t\treturn new Symbols();\n\t}\n\tself = this;\n\n\topts = copy( defaults );\n\topts.isDefined = isDefined;\n\topts.xScale = linear();\n\topts.yScale = linear();\n\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = merge( opts, options );\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tfor ( i = 0; i < PRIVATE_PROPS.length; i++ ) {\n\t\tdefineProperty( this, PRIVATE_PROPS[i], {\n\t\t\t'configurable': false,\n\t\t\t'enumerable': false,\n\t\t\t'writable': true,\n\t\t\t'value': null\n\t\t});\n\t}\n\t// Set options...\n\tkeys = objectKeys( opts );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tthis[ key ] = opts[ key ];\n\t}\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Create a prototype which inherits from the parent prototype.\n*/\nSymbols.prototype = Object.create( EventEmitter.prototype );\n\n/*\n* Set the constructor.\n*/\nSymbols.prototype.constructor = Symbols;\n\n/**\n* Symbol.\n*\n* @name symbol\n* @memberof Symbols.prototype\n* @type {string}\n* @throws {TypeError} must be a supported symbol\n* @default 'closed-circle'\n*\n* @example\n* var symbols = new Symbols({\n* 'symbol': 'open-circle'\n* });\n*\n* var symbol = symbols.symbol;\n* // returns 'open-circle'\n*/\ndefineProperty( Symbols.prototype, 'symbol', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSymbol,\n\t'get': getSymbol\n});\n\n/**\n* `x` values.\n*\n* @name x\n* @memberof Symbols.prototype\n* @type {ArrayLike}\n* @throws {TypeError} must be array-like\n* @default []\n*\n* @example\n* var symbols = new Symbols({\n* 'x': [0.1,0.2,0.3]\n* });\n*\n* var x = symbols.x;\n* // returns [0.1,0.2,0.3]\n*/\ndefineProperty( Symbols.prototype, 'x', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setX,\n\t'get': getX\n});\n\n/**\n* `y` values.\n*\n* @name y\n* @memberof Symbols.prototype\n* @type {ArrayLike}\n* @throws {TypeError} must be array-like\n* @default []\n*\n* @example\n* var symbols = new Symbols({\n* 'y': [0.4,0.5,0.6]\n* });\n*\n* var y = symbols.y;\n* // returns [0.4,0.5,0.6]\n*/\ndefineProperty( Symbols.prototype, 'y', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setY,\n\t'get': getY\n});\n\n/**\n* `x` scale function.\n*\n* @name xScale\n* @memberof Symbols.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var symbols = new Symbols({\n* 'xScale': function scale(){}\n* });\n*\n* var f = symbols.xScale;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'xScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXScale,\n\t'get': getXScale\n});\n\n/**\n* `y` scale function.\n*\n* @name yScale\n* @memberof Symbols.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var symbols = new Symbols({\n* 'yScale': function scale(){}\n* });\n*\n* var f = symbols.yScale;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'yScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYScale,\n\t'get': getYScale\n});\n\n/**\n* Accessor which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`.\n*\n* @name isDefined\n* @memberof Symbols.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var symbols = new Symbols();\n* symbols.isDefined = function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n*\n* @example\n* function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n* var symbols = new Symbols({\n* 'isDefined': isDefined\n* });\n* var fcn = symbols.isDefined;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'isDefined', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setIsDefined,\n\t'get': getIsDefined\n});\n\n/**\n* Symbol size. When retrieved, the returned value is a size accessor.\n*\n* @name size\n* @memberof Symbols.prototype\n* @type {(NonNegativeInteger|Function)}\n* @throws {TypeError} must be a nonnegative integer or function\n* @default 6\n*\n* @example\n* var symbols = new Symbols({\n* 'size': 5\n* });\n*\n* var size = symbols.size;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'size', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSize,\n\t'get': getSize\n});\n\n/**\n* Symbol opacity. When retrieved, the returned value is an opacity accessor.\n*\n* @name opacity\n* @memberof Symbols.prototype\n* @type {(number|Function)}\n* @throws {TypeError} must be a number or function\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.9\n*\n* @example\n* var symbols = new Symbols({\n* 'opacity': 0.5\n* });\n*\n* var opacity = symbols.opacity;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'opacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOpacity,\n\t'get': getOpacity\n});\n\n/**\n* Symbols color. When retrieved, the returned value is a color accessor.\n*\n* @name color\n* @memberof Symbols.prototype\n* @type {(string|Function)}\n* @throws {TypeError} must be a string or function\n*\n* @example\n* var symbols = new Symbols({\n* 'color': 'steelblue'\n* });\n*\n* var color = symbols.color;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'color', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setColor,\n\t'get': getColor\n});\n\n/**\n* Symbols label. When retrieved, the returned value is a label accessor.\n*\n* @name label\n* @memberof Symbols.prototype\n* @type {(string|Function)}\n* @throws {TypeError} must be a string or function\n*\n* @example\n* var symbols = new Symbols({\n* 'label': 'group-1'\n* });\n*\n* var label = symbols.label;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'label', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLabel,\n\t'get': getLabel\n});\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Symbols.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var symbols = new Symbols({\n* 'autoRender': true\n* });\n*\n* var mode = symbols.autoRender;\n* // returns true\n*/\ndefineProperty( Symbols.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Function to map values to x coordinate values.\n*\n* @name xPos\n* @memberof Symbols.prototype\n* @type {Function}\n*\n* @example\n* var symbols = new Symbols();\n* var xPos = symbols.xPos;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'xPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getXPos\n});\n\n/**\n* Function to map values to y coordinate values.\n*\n* @name yPos\n* @memberof Symbols.prototype\n* @type {Function}\n*\n* @example\n* var symbols = new Symbols();\n* var yPos = symbols.yPos;\n* // returns \n*/\ndefineProperty( Symbols.prototype, 'yPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getYPos\n});\n\n/**\n* Renders a virtual DOM tree.\n*\n* @name render\n* @memberof Symbols.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var symbols = new Symbols();\n*\n* var out = symbols.render();\n*/\nsetReadOnly( Symbols.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Symbols;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the symbol.\n*\n* @private\n* @returns {string} symbol\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._symbol;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the `x` values.\n*\n* @private\n* @returns {ArrayLike} x values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xData;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the `y` values.\n*\n* @private\n* @returns {ArrayLike} y values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yData;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xScale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yScale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the accessor for defined values.\n*\n* @private\n* @returns {Function} accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._isDefined;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a symbol's size.\n*\n* @private\n* @returns {Function} size accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isNumber( this._size ) ) {\n\t\treturn size;\n\t}\n\treturn this._size;\n\n\t/**\n\t* Returns the size.\n\t*\n\t* @private\n\t* @returns {number} size\n\t*/\n\tfunction size() {\n\t\treturn self._size; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a symbol's opacity.\n*\n* @private\n* @returns {Function} opacity accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isNumber( this._opacity ) ) {\n\t\treturn opacity;\n\t}\n\treturn this._opacity;\n\n\t/**\n\t* Returns the opacity.\n\t*\n\t* @private\n\t* @returns {number} opacity\n\t*/\n\tfunction opacity() {\n\t\treturn self._opacity; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a symbol's color.\n*\n* @private\n* @returns {Function} color accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isString( this._color ) ) {\n\t\treturn color;\n\t}\n\treturn this._color;\n\n\t/**\n\t* Returns the color.\n\t*\n\t* @private\n\t* @returns {string} color\n\t*/\n\tfunction color() {\n\t\treturn self._color; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a symbol's label.\n*\n* @private\n* @returns {Function} label accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isString( this._label ) ) {\n\t\treturn label;\n\t}\n\treturn this._label;\n\n\t/**\n\t* Returns the label.\n\t*\n\t* @private\n\t* @returns {string} label\n\t*/\n\tfunction label() {\n\t\treturn self._label; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isnan } from '@stdlib/assert/is-nan';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:accessor:is-defined' );\n\n\n// MAIN //\n\n/**\n* Predicate function which returns a boolean indicating whether a datum is defined.\n*\n* @private\n* @param {number} d - datum\n* @param {integer} i - index\n* @returns {boolean} boolean indicating whether a datum is defined\n*/\nfunction isDefined( d ) {\n\tvar bool = !isnan( d );\n\tdebug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool );\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isDefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isBoolean } from '@stdlib/assert/is-boolean';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:auto-render' );\n\n\n// MAIN //\n\n/**\n* Sets the rendering mode.\n*\n* @private\n* @param {boolean} bool - boolean indicating whether to re-render on a change event\n* @throws {TypeError} must be a boolean\n*/\nfunction set( bool ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isBoolean( bool ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) );\n\t}\n\tif ( bool !== this._autoRender ) {\n\t\tdebug( 'Current value: %d.', this._autoRender );\n\n\t\tthis._autoRender = bool;\n\t\tdebug( 'New Value: %d.', this._autoRender );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:color' );\n\n\n// MAIN //\n\n/**\n* Sets the color.\n*\n* @private\n* @param {(string|Function)} color - color\n* @throws {TypeError} must be a string or function\n*/\nfunction set( color ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( color ) && !isFunction( color ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'color', color ) );\n\t}\n\tif ( color !== this._color ) {\n\t\tdebug( 'Current value: %d.', this._color );\n\n\t\tthis._color = color;\n\t\tdebug( 'New Value: %d.', this._color );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isArrayLike from '@stdlib/assert/is-array-like';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:data' );\n\n\n// MAIN //\n\n/**\n* Sets the data values.\n*\n* ## Notes\n*\n* - We always fire a `change` event when set, even if the provided reference is the same, to allow signaling that data values have changed (e.g., a data array has mutated).\n*\n* @private\n* @param {ArrayLike} data - data values\n* @throws {TypeError} must be array-like\n*/\nfunction set( data ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isArrayLike( data ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be array-like. Value: `%s`.', 'data', data ) );\n\t}\n\tdebug( 'Current value: %s.', JSON.stringify( this._data ) );\n\n\tthis._data = data;\n\tdebug( 'New Value: %s.', JSON.stringify( this._data ) );\n\n\tthis.emit( 'change' );\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:is-defined' );\n\n\n// MAIN //\n\n/**\n* Sets the predicate function for determining whether a value is defined.\n*\n* @private\n* @param {Function} fcn - predicate function\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) );\n\t}\n\tif ( fcn !== this._isDefined ) {\n\t\tdebug( 'Current value: %s.', this._isDefined );\n\n\t\tthis._isDefined = fcn;\n\t\tdebug( 'New Value: %s.', this._isDefined );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:label' );\n\n\n// MAIN //\n\n/**\n* Sets the label.\n*\n* @private\n* @param {(string|Function)} label - label\n* @throws {TypeError} must be a string or a function\n*/\nfunction set( label ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isString( label ) && !isFunction( label ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a string or a function. Value: `%s`.', 'label', label ) );\n\t}\n\tif ( label !== this._label ) {\n\t\tdebug( 'Current value: %d.', this._label );\n\n\t\tthis._label = label;\n\t\tdebug( 'New Value: %d.', this._label );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:opacity' );\n\n\n// MAIN //\n\n/**\n* Sets the opacity.\n*\n* @private\n* @param {(number|Function)} opacity - opacity\n* @throws {TypeError} must be a number or a function\n* @throws {RangeError} must be a number on the interval `[0,1]`\n*/\nfunction set( opacity ) {\n\t/* eslint-disable no-invalid-this */\n\tvar isNum = isNumber( opacity );\n\tif ( !isNum && !isFunction( opacity ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a number or a function. Value: `%s`.', 'opacity', opacity ) );\n\t}\n\tif ( isNum && (opacity !== opacity || opacity < 0.0 || opacity > 1.0) ) {\n\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) );\n\t}\n\tif ( opacity !== this._opacity ) {\n\t\tdebug( 'Current value: %d.', this._opacity );\n\n\t\tthis._opacity = opacity;\n\t\tdebug( 'New Value: %d.', this._opacity );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport indexOf from '@stdlib/utils/index-of';\nimport format from '@stdlib/string/format';\nimport ORIENTATIONS from './orientations.json';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:orientation' );\n\n\n// MAIN //\n\n/**\n* Sets the orientation.\n*\n* @private\n* @param {string} orient - orientation\n* @throws {TypeError} must be a supported orientation\n*/\nfunction set( orient ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( indexOf( ORIENTATIONS, orient ) === -1 ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be one of the following: \"%s\". Value: `%s`.', 'orientation', ORIENTATIONS.join( '\", \"' ), orient ) );\n\t}\n\tif ( orient !== this._orientation ) {\n\t\tdebug( 'Current value: %d.', this._orientation );\n\n\t\tthis._orientation = orient;\n\t\tdebug( 'New Value: %d.', this._orientation );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:pos' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values to coordinate values.\n*\n* @private\n* @returns {Function} map function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar scale = this.scale;\n\treturn pos;\n\n\t/**\n\t* Maps a value to a coordinate value.\n\t*\n\t* @private\n\t* @param {*} d - datum\n\t* @returns {number} pixel value\n\t*/\n\tfunction pos( d ) {\n\t\tvar p = scale( d );\n\t\tdebug( 'Value: %d => Pixel: %d.', d, p );\n\t\treturn p;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport isFunction from '@stdlib/assert/is-function';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:scale' );\n\n\n// MAIN //\n\n/**\n* Sets the scale function.\n*\n* @private\n* @param {Function} fcn - scale\n* @throws {TypeError} must be a function\n*/\nfunction set( fcn ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'scale', fcn ) );\n\t}\n\tif ( fcn !== this._scale ) {\n\t\tdebug( 'Current value: %s.', this._scale );\n\n\t\tthis._scale = fcn;\n\t\tdebug( 'New Value: %s.', this._scale );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:set:size' );\n\n\n// MAIN //\n\n/**\n* Sets the tick (tassel) size.\n*\n* @private\n* @param {NonNegativeInteger} size - size\n* @throws {TypeError} must be a nonnegative integer\n*/\nfunction set( size ) {\n\t/* eslint-disable no-invalid-this */\n\tif ( !isNonNegativeInteger( size ) ) {\n\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a nonnegative integer. Value: `%s`.', 'size', size ) );\n\t}\n\tif ( size !== this._size ) {\n\t\tdebug( 'Current value: %d.', this._size );\n\n\t\tthis._size = size;\n\t\tdebug( 'New Value: %d.', this._size );\n\n\t\tthis.emit( 'change' );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default set;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport xAttr from './utils/x_attr.js';\nimport yAttr from './utils/y_attr.js';\nimport tickDir from './utils/tick_dir.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:render:ticks' );\nvar ELEMENT = 'line';\n\n\n// MAIN //\n\n/**\n* Renders rug ticks (tassels).\n*\n* @private\n* @param {Object} ctx - context\n* @returns {Array} array of virtual trees\n*/\nfunction render( ctx ) {\n\tvar props;\n\tvar data;\n\tvar out;\n\tvar pos;\n\tvar dir;\n\tvar p;\n\tvar x;\n\tvar y;\n\tvar d;\n\tvar i;\n\n\tdebug( 'Rendering ticks...' );\n\n\tdata = ctx.data;\n\tpos = ctx.pos;\n\tx = xAttr( ctx.orientation );\n\ty = yAttr( ctx.orientation );\n\tdir = tickDir( ctx.orientation );\n\n\tout = new Array( data.length );\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\td = data[ i ];\n\t\tif ( !ctx.isDefined( d, i ) ) {\n\t\t\tdebug( 'Datum %d is not defined. Value: %s.', i, d );\n\t\t\tcontinue;\n\t\t}\n\t\tprops = {\n\t\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t\t'property': 'rug.tick',\n\t\t\t'className': 'tick',\n\t\t\t'attributes': {\n\t\t\t\t'fill': 'none',\n\t\t\t\t'opacity': ctx.opacity( d, i ),\n\t\t\t\t'stroke': ctx.color( d, i ),\n\t\t\t\t'stroke-width': 1,\n\t\t\t\t'data-label': ctx.label( d, i )\n\t\t\t}\n\t\t};\n\n\t\tp = pos( d );\n\t\tprops.attributes[ x+'1' ] = 0;\n\t\tprops.attributes[ x+'2' ] = dir * ctx.size;\n\t\tprops.attributes[ y+'1' ] = p;\n\t\tprops.attributes[ y+'2' ] = p;\n\n\t\tdebug( 'Rendering tick %d with value %s...', i, d );\n\n\t\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\t\tout[ i ] = h( ELEMENT, props, [] );\n\t}\n\tdebug( 'Finished rendering ticks.' );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar h = require( 'virtual-dom/h.js' );\nimport ticks from './ticks.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:render' );\nvar ELEMENT = 'g';\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @returns {VTree} virtual tree\n*/\nfunction render() {\n\t/* eslint-disable no-invalid-this */\n\tvar children;\n\tvar props;\n\tvar vtree;\n\n\tdebug( 'Rendering...' );\n\n\tprops = {\n\t\t'namespace': 'http://www.w3.org/2000/svg',\n\t\t'property': 'rug',\n\t\t'className': 'rug'\n\t};\n\n\tchildren = ticks( this );\n\n\tdebug( 'Generating a virtual DOM tree (%s) with properties: %s.', ELEMENT, JSON.stringify( props ) );\n\tvtree = h( ELEMENT, props, children );\n\n\t// Announce that a new tree has been rendered:\n\tthis.emit( '_render', vtree );\n\n\treturn vtree;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nvar linear = require( 'd3-scale' ).scaleLinear; // TODO: remove\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport objectKeys from '@stdlib/utils/keys';\nimport format from '@stdlib/string/format';\nimport copy from '@stdlib/utils/copy';\nimport merge from '@stdlib/utils/merge';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport instanceOf from '@stdlib/assert/instance-of';\nimport inherit from '@stdlib/utils/inherit';\nimport isDefined from './accessors/is_defined.js';\nimport defaults from './defaults.json';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport setColor from './props/color/set.js';\nimport getColor from './props/color/get.js';\nimport setData from './props/data/set.js';\nimport getData from './props/data/get.js';\nimport setIsDefined from './props/is-defined/set.js';\nimport getIsDefined from './props/is-defined/get.js';\nimport setLabel from './props/label/set.js';\nimport getLabel from './props/label/get.js';\nimport setOpacity from './props/opacity/set.js';\nimport getOpacity from './props/opacity/get.js';\nimport setOrientation from './props/orientation/set.js';\nimport getOrientation from './props/orientation/get.js';\nimport getPos from './props/pos/get.js';\nimport setScale from './props/scale/set.js';\nimport getScale from './props/scale/get.js';\nimport setSize from './props/size/set.js';\nimport getSize from './props/size/get.js';\nimport render from './render';\n\n\n// VARIABLES //\n\nvar debug = logger( 'rug:main' );\nvar PRIVATE_PROPS = [\n\t'_autoRender',\n\t'_color',\n\t'_data',\n\t'_isDefined',\n\t'_label',\n\t'_opacity',\n\t'_orientation',\n\t'_scale',\n\t'_size'\n];\n\n\n// MAIN //\n\n/**\n* Rug constructor.\n*\n* @constructor\n* @param {Options} [options] - constructor options\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @param {(string|Function)} [options.color=\"#aaa\"] - color\n* @param {ArrayLike} [options.data=[]] - data\n* @param {Function} [options.isDefined] - predicate function indicating whether a datum is defined\n* @param {(string|Function)} [options.label] - label\n* @param {(number|Function)} [options.opacity=0.9] - opacity\n* @param {string} [options.orientation=\"bottom\"] - orientation\n* @param {Function} [options.scale] - scale function\n* @param {NonNegativeInteger} [options.size=6] - tick (tassel) size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Rug} Rug instance\n*\n* @example\n* var node = new Rug({\n* 'data': [ 0.1, 0.2, 0.3 ]\n* });\n* // returns \n*/\nfunction Rug( options ) {\n\tvar self;\n\tvar keys;\n\tvar opts;\n\tvar key;\n\tvar i;\n\tif ( !instanceOf( this, Rug ) ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn new Rug( options );\n\t\t}\n\t\treturn new Rug();\n\t}\n\tself = this;\n\n\topts = copy( defaults );\n\topts.isDefined = isDefined;\n\topts.scale = linear();\n\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = merge( opts, options );\n\t}\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tfor ( i = 0; i < PRIVATE_PROPS.length; i++ ) {\n\t\tdefineProperty( this, PRIVATE_PROPS[i], {\n\t\t\t'configurable': false,\n\t\t\t'enumerable': false,\n\t\t\t'writable': true,\n\t\t\t'value': null\n\t\t});\n\t}\n\t// Set options...\n\tkeys = objectKeys( opts );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tthis[ key ] = opts[ key ];\n\t}\n\n\tthis.on( 'change', onChange );\n\tthis.on( '_render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Re-emits a render event.\n\t*\n\t* @private\n\t*/\n\tfunction onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\tdebug( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}\n}\n\n/*\n* Inherit from the `EventEmitter` prototype.\n*/\ninherit( Rug, EventEmitter );\n\n/**\n* Rendering mode. If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Rug.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var node = new Rug({\n* 'autoRender': true\n* });\n*\n* var mode = node.autoRender;\n* // returns true\n*/\ndefineProperty( Rug.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Tick color. When retrieved, the returned value is a color accessor.\n*\n* @name color\n* @memberof Rug.prototype\n* @type {(string|Function)}\n* @throws {TypeError} must be a string or function\n*\n* @example\n* var node = new Rug({\n* 'color': 'steelblue'\n* });\n*\n* var color = node.color;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'color', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setColor,\n\t'get': getColor\n});\n\n/**\n* Data.\n*\n* @name data\n* @memberof Rug.prototype\n* @type {ArrayLike}\n* @throws {TypeError} must be array-like\n* @default []\n*\n* @example\n* var node = new Rug({\n* 'data': [ 0.1, 0.2, 0.3 ]\n* });\n*\n* var data = node.data;\n* // returns [ 0.1, 0.2, 0.3 ]\n*/\ndefineProperty( Rug.prototype, 'data', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setData,\n\t'get': getData\n});\n\n/**\n* Predicate function which defines whether a datum is defined. This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`.\n*\n* @name isDefined\n* @memberof Rug.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var node = new Rug();\n*\n* function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n* node.isDefined = isDefined;\n*\n* @example\n* function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n* var node = new Rug({\n* 'isDefined': isDefined\n* });\n* var fcn = node.isDefined;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'isDefined', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setIsDefined,\n\t'get': getIsDefined\n});\n\n/**\n* Tick label. When retrieved, the returned value is a label accessor.\n*\n* @name label\n* @memberof Rug.prototype\n* @type {(string|Function)}\n* @throws {TypeError} must be a string or function\n*\n* @example\n* var node = new Rug({\n* 'label': 'group-1'\n* });\n*\n* var label = node.label;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'label', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLabel,\n\t'get': getLabel\n});\n\n/**\n* Tick opacity. When retrieved, the returned value is an opacity accessor.\n*\n* @name opacity\n* @memberof Rug.prototype\n* @type {number}\n* @throws {TypeError} must be a number\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.9\n*\n* @example\n* var node = new Rug({\n* 'opacity': 0.5\n* });\n*\n* var opacity = node.opacity;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'opacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOpacity,\n\t'get': getOpacity\n});\n\n/**\n* Rug orientation.\n*\n* @name orientation\n* @memberof Rug.prototype\n* @type {string}\n* @throws {TypeError} must be a supported orientation\n*\n* @example\n* var node = new Rug({\n* 'orientation': 'left'\n* });\n*\n* var orient = node.orientation;\n* // returns 'left'\n*/\ndefineProperty( Rug.prototype, 'orientation', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setOrientation,\n\t'get': getOrientation\n});\n\n/**\n* Function to map values to x coordinate values.\n*\n* @name pos\n* @memberof Rug.prototype\n* @type {Function}\n*\n* @example\n* var node = new Rug();\n*\n* var pos = node.pos;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'pos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getPos\n});\n\n/**\n* Scale function.\n*\n* @name scale\n* @memberof Rug.prototype\n* @type {Function}\n* @throws {TypeError} must be a function\n*\n* @example\n* var node = new Rug({\n* 'scale': function scale() {}\n* });\n*\n* var fcn = node.scale;\n* // returns \n*/\ndefineProperty( Rug.prototype, 'scale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setScale,\n\t'get': getScale\n});\n\n/**\n* Tick (tassel) size.\n*\n* @name size\n* @memberof Rug.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 6\n*\n* @example\n* var node = new Rug({\n* 'size': 5\n* });\n*\n* var size = node.size;\n* // returns 5\n*/\ndefineProperty( Rug.prototype, 'size', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSize,\n\t'get': getSize\n});\n\n/**\n* Renders a Virtual DOM tree.\n*\n* @name render\n* @memberof Rug.prototype\n* @type {Function}\n* @returns {VTree} virtual tree\n*\n* @example\n* var node = new Rug();\n*\n* var out = node.render();\n* // returns \n*/\nsetReadOnly( Rug.prototype, 'render', render );\n\n\n// EXPORTS //\n\nexport default Rug;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a color.\n*\n* @private\n* @returns {Function} color accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isString( this._color ) ) {\n\t\treturn color;\n\t}\n\treturn this._color;\n\n\t/**\n\t* Returns a color value.\n\t*\n\t* @private\n\t* @returns {string} color\n\t*/\n\tfunction color() {\n\t\treturn self._color; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data values.\n*\n* @private\n* @returns {ArrayLike} data values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._data;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the predicate function for determining whether a value is defined.\n*\n* @private\n* @returns {Function} predicate function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._isDefined;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\n\n\n// MAIN //\n\n/**\n* Returns a function to get a label.\n*\n* @private\n* @returns {Function} label accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isString( this._label ) ) {\n\t\treturn label;\n\t}\n\treturn this._label;\n\n\t/**\n\t* Returns a label.\n\t*\n\t* @private\n\t* @returns {string} label\n\t*/\n\tfunction label() {\n\t\treturn self._label; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\n\n\n// MAIN //\n\n/**\n* Returns a function to get an opacity.\n*\n* @private\n* @returns {Function} opacity accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( isNumber( this._opacity ) ) {\n\t\treturn opacity;\n\t}\n\treturn this._opacity;\n\n\t/**\n\t* Returns the opacity.\n\t*\n\t* @private\n\t* @returns {number} opacity\n\t*/\n\tfunction opacity() {\n\t\treturn self._opacity; // eslint-disable-line no-underscore-dangle\n\t}\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the orientation.\n*\n* @private\n* @returns {string} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._orientation;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the scale function.\n*\n* @private\n* @returns {Function} scale function\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._scale;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the tick (tassel) size.\n*\n* @private\n* @returns {NonNegativeInteger} tick size\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._size;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the \"x\" attribute for tick positioning.\n*\n* @private\n* @param {string} orient - rug orientation\n* @returns {string} attribute\n*/\nfunction xAttr( orient ) {\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\treturn 'x';\n\t}\n\treturn 'y';\n}\n\n\n// EXPORTS //\n\nexport default xAttr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the \"y\" attribute for tick positioning.\n*\n* @private\n* @param {string} orient - rug orientation\n* @returns {string} attribute\n*/\nfunction yAttr( orient ) {\n\tif ( orient === 'left' || orient === 'right' ) {\n\t\treturn 'y';\n\t}\n\treturn 'x';\n}\n\n\n// EXPORTS //\n\nexport default yAttr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the tick direction.\n*\n* @private\n* @param {string} orient - orientation\n* @returns {number} tick direction\n*/\nfunction tickDir( orient ) {\n\tif ( orient === 'bottom' || orient === 'right' ) {\n\t\treturn -1;\n\t}\n\treturn 1;\n}\n\n\n// EXPORTS //\n\nexport default tickDir;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport defineProperty from '@stdlib/utils/define-property';\nimport Annotations from './../../../../components/svg/annotations';\nimport ClipPath from './../../../../components/svg/clip-path';\nimport Canvas from './../../../../components/svg/canvas';\nimport Graph from './../../../../components/svg/graph';\nimport Title from './../../../../components/svg/title';\nimport Marks from './../../../../components/svg/marks';\nimport Bkgd from './../../../../components/svg/background';\nimport Defs from './../../../../components/svg/defs';\nimport Axis from './../../../../components/svg/axis';\nimport Path from './../../../../components/svg/path';\nimport Symbols from './../../../../components/svg/symbols';\nimport Rug from './../../../../components/svg/rug';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:init' );\n\n\n// MAIN //\n\n/**\n* Initializes SVG components.\n*\n* @private\n* @param {Object} state - state\n*/\nfunction init( state ) {\n\tvar svg = state.$.svg;\n\n\tdebug( 'Initializing components...' );\n\n\tdebug( 'Initializing canvas component...' );\n\tdefineProperty( svg, 'canvas', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Canvas({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing definitions component...' );\n\tdefineProperty( svg, 'defs', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Defs({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing clipping path component...' );\n\tdefineProperty( svg, 'clipPath', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new ClipPath({\n\t\t\t'autoRender': false,\n\t\t\t'id': state._clipPathId // eslint-disable-line no-underscore-dangle\n\t\t})\n\t});\n\n\tdebug( 'Initializing graph component...' );\n\tdefineProperty( svg, 'graph', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Graph({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing annotations component...' );\n\tdefineProperty( svg, 'annotations', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Annotations({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing title component...' );\n\tdefineProperty( svg, 'title', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Title({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing background component...' );\n\tdefineProperty( svg, 'bkgd', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Bkgd({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing marks component...' );\n\tdefineProperty( svg, 'marks', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Marks({\n\t\t\t'autoRender': false,\n\t\t\t'clipPathId': state._clipPathId // eslint-disable-line no-underscore-dangle\n\t\t})\n\t});\n\n\tdebug( 'Initializing path component...' );\n\tdefineProperty( svg, 'path', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Path({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing symbols component...' );\n\tdefineProperty( svg, 'symbols', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Symbols({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing x-axis rug component...' );\n\tdefineProperty( svg, 'xRug', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Rug({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing y-axis rug component...' );\n\tdefineProperty( svg, 'yRug', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Rug({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing x-axis component...' );\n\tdefineProperty( svg, 'xAxis', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Axis({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'Initializing y-axis component...' );\n\tdefineProperty( svg, 'yAxis', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': new Axis({\n\t\t\t'autoRender': false\n\t\t})\n\t});\n\n\tdebug( 'All components initialized.' );\n}\n\n\n// EXPORTS //\n\nexport default init;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:sync' );\n\n\n// MAIN //\n\n/**\n* Syncs SVG components with the current state.\n*\n* @private\n* @param {Object} state - state\n*/\nfunction sync( state ) {\n\tvar svg = state.$.svg;\n\n\tdebug( 'Syncing...' );\n\n\tdebug( 'Syncing canvas...' );\n\tsvg.canvas.width = state.width;\n\tsvg.canvas.height = state.height;\n\n\tdebug( 'Syncing definitions...' );\n\n\t// ...\n\n\tdebug( 'Syncing clipping path...' );\n\tsvg.clipPath.width = state.graphWidth;\n\tsvg.clipPath.height = state.graphHeight;\n\n\tdebug( 'Syncing graph...' );\n\tsvg.graph.translateX = state.paddingLeft;\n\tsvg.graph.translateY = state.paddingTop;\n\n\tdebug( 'Syncing annotations...' );\n\n\t// ...\n\n\tdebug( 'Syncing title...' );\n\tsvg.title.text = state.title;\n\n\tdebug( 'Syncing background...' );\n\tsvg.bkgd.width = state.graphWidth;\n\tsvg.bkgd.height = state.graphHeight;\n\n\tdebug( 'Syncing marks...' );\n\tsvg.marks.clipPathId = state._clipPathId; // eslint-disable-line no-underscore-dangle\n\n\tdebug( 'Syncing path...' );\n\tsvg.path.xScale = state.xScale;\n\tsvg.path.yScale = state.yScale;\n\n\t// svg.path.isDefined = state.isDefined; // TODO\n\n\tdebug( 'Syncing symbols...' );\n\tsvg.symbols.xScale = state.xScale;\n\tsvg.symbols.yScale = state.yScale;\n\n\t// svg.symbols.isDefined = state.isDefined; // TODO\n\n\tdebug( 'Syncing x-axis rug...' );\n\tsvg.xRug.scale = state.xScale;\n\n\t// svg.xRug.isDefined = state.isDefined; // TODO\n\n\tdebug( 'Syncing y-axis rug...' );\n\tsvg.yRug.scale = state.yScale;\n\n\t// svg.yRug.isDefined = state.isDefined; // TODO\n\n\tdebug( 'Syncing x-axis...' );\n\tsvg.xAxis.scale = state.xScale;\n\tsvg.xAxis.label = state.xLabel;\n\tsvg.xAxis.tickFormat = state.xTickFormat;\n\tsvg.xAxis.numTicks = state.xNumTicks;\n\tsvg.xAxis.orientation = state.xAxisOrient;\n\n\tdebug( 'Syncing y-axis...' );\n\tsvg.yAxis.scale = state.yScale;\n\tsvg.yAxis.label = state.yLabel;\n\tsvg.yAxis.tickFormat = state.yTickFormat;\n\tsvg.yAxis.numTicks = state.yNumTicks;\n\tsvg.yAxis.orientation = state.yAxisOrient;\n\n\tdebug( 'Sync complete.' );\n}\n\n\n// EXPORTS //\n\nexport default sync;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport xAxisTransform from './utils/x_axis_transform.js';\nimport yAxisTransform from './utils/y_axis_transform.js';\nimport renderMarks from './marks';\nimport init from './init.js';\nimport sync from './sync.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render:svg:main' );\n\n\n// MAIN //\n\n/**\n* Renders a virtual DOM tree.\n*\n* @private\n* @param {Object} state - state\n* @returns {VTree} virtual tree\n*/\nfunction render( state ) {\n\tvar annotations;\n\tvar clipPath;\n\tvar canvas;\n\tvar title;\n\tvar graph;\n\tvar marks;\n\tvar xAxis;\n\tvar yAxis;\n\tvar bkgd;\n\tvar defs;\n\tvar svg;\n\n\tsvg = state.$.svg;\n\n\t// Lazily initialize...\n\tif ( !svg.canvas ) {\n\t\tdebug( 'Initializing components...' );\n\t\tinit( state );\n\t}\n\tdebug( 'Syncing component states...' );\n\tsync( state );\n\n\tdebug( 'Rendering individual components...' );\n\n\tdebug( 'Rendering annotations...' );\n\tannotations = svg.annotations.render();\n\n\tdebug( 'Rendering clip-path...' );\n\tclipPath = svg.clipPath.render();\n\n\tdebug( 'Rendering canvas...' );\n\tcanvas = svg.canvas.render();\n\n\tdebug( 'Rendering graph...' );\n\tgraph = svg.graph.render();\n\n\tdebug( 'Rendering title...' );\n\ttitle = svg.title.render();\n\n\tdebug( 'Rendering x-axis...' );\n\txAxis = svg.xAxis.render();\n\n\tdebug( 'Rendering y-axis...' );\n\tyAxis = svg.yAxis.render();\n\n\tdebug( 'Rendering background...' );\n\tbkgd = svg.bkgd.render();\n\n\tdebug( 'Rendering definitions...' );\n\tdefs = svg.defs.render();\n\n\tdebug( 'Rendering marks...' );\n\tmarks = renderMarks( state );\n\n\tdebug( 'Updating rendered components...' );\n\n\tdebug( 'Updating title...' );\n\ttitle.properties.attributes.x = state.paddingLeft + ( state.graphWidth/2 );\n\ttitle.properties.attributes.y = state.paddingTop / 2;\n\n\tdebug( 'Updating x-axis...' );\n\txAxis.properties.className += ' x';\n\txAxis.properties.attributes.transform = xAxisTransform( state.xAxisOrient, state.graphHeight ); // eslint-disable-line max-len\n\n\tdebug( 'Updating y-axis...' );\n\tyAxis.properties.className += ' y';\n\tyAxis.properties.attributes.transform = yAxisTransform( state.yAxisOrient, state.graphWidth ); // eslint-disable-line max-len\n\n\tdebug( 'Assembling virtual tree...' );\n\n\tdebug( 'Inserting clip-path into definitions...' );\n\tdefs.children.push( clipPath );\n\tdefs.count += clipPath.count;\n\n\tdebug( 'Inserting background into graph...' );\n\tgraph.children.push( bkgd );\n\tgraph.count += bkgd.count;\n\n\tdebug( 'Inserting marks into graph...' );\n\tgraph.children.push( marks );\n\tgraph.count += marks.count;\n\n\tdebug( 'Inserting x-axis into graph...' );\n\tgraph.children.push( xAxis );\n\tgraph.count += xAxis.count;\n\n\tdebug( 'Inserting y-axis into graph...' );\n\tgraph.children.push( yAxis );\n\tgraph.count += yAxis.count;\n\n\tdebug( 'Inserting title into annotations...' );\n\tannotations.children.push( title );\n\tannotations.count += title.count;\n\n\tdebug( 'Inserting definitions into canvas...' );\n\tcanvas.children.push( defs );\n\tcanvas.count += defs.count;\n\n\tdebug( 'Inserting graph into canvas...' );\n\tcanvas.children.push( graph );\n\tcanvas.count += graph.count;\n\n\tdebug( 'Inserting annotations into canvas...' );\n\tcanvas.children.push( annotations );\n\tcanvas.count += annotations.count;\n\n\treturn canvas;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns an x-axis translation transform.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {number} height - graph height\n* @returns {string} transform\n*/\nfunction xAxisTransform( orient, height ) {\n\tif ( orient === 'top' ) {\n\t\treturn 'translate(0,0)';\n\t}\n\treturn 'translate(0,'+height+')';\n}\n\n\n// EXPORTS //\n\nexport default xAxisTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a y-axis translation transform.\n*\n* @private\n* @param {string} orient - axis orientation\n* @param {number} width - graph width\n* @returns {string} transform\n*/\nfunction yAxisTransform( orient, width ) {\n\tif ( orient === 'left' ) {\n\t\treturn 'translate(0,0)';\n\t}\n\treturn 'translate('+width+',0)';\n}\n\n\n// EXPORTS //\n\nexport default yAxisTransform;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar vdom2html = require( 'vdom-to-html' );\nimport renderSVG from './svg';\nimport validate from './validate.js';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:render' );\n\n\n// MAIN //\n\n/**\n* Renders a plot.\n*\n* @private\n* @param {string} [format] - render format\n* @returns {(VTree|string)} virtual tree or a string\n*/\nfunction render( format ) {\n\t/* eslint-disable no-invalid-this */\n\tvar out;\n\tvar tmp;\n\tvar fmt;\n\n\ttmp = this.renderFormat;\n\tif ( arguments.length ) {\n\t\t// Temporarily set the render format:\n\t\tthis.renderFormat = format;\n\t\tfmt = format;\n\t} else {\n\t\tfmt = tmp;\n\t}\n\tdebug( 'Validating render state...' );\n\tvalidate( this );\n\n\tdebug( 'Render format: %s.', this.renderFormat );\n\tdebug( 'Rendering...' );\n\tif ( this._engine === 'svg' ) {\n\t\tout = renderSVG( this );\n\n\t\t// Default render format is virtual DOM.\n\t\tif ( fmt === 'html' ) {\n\t\t\tout = vdom2html( out );\n\t\t}\n\t\tthis.emit( 'render', out );\n\t}\n\tif ( arguments.length ) {\n\t\t// Restore the render format:\n\t\tthis.renderFormat = tmp;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default render;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nimport _view from './view.js'; // eslint-disable-line no-underscore-dangle\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:view' );\n\n\n// MAIN //\n\n/**\n* Generates a plot view.\n*\n* @private\n* @param {string} viewer - plot viewer\n*/\nfunction view( viewer ) {\n\t/* eslint-disable no-invalid-this */\n\tvar tmp = this.viewer;\n\tif ( arguments.length ) {\n\t\t// Temporarily set the viewer:\n\t\tthis.viewer = viewer;\n\t}\n\tdebug( 'Viewer: %s.', this.viewer );\n\tdebug( 'Generating view...' );\n\t_view( this, this.viewer, this.render() );\n\tif ( arguments.length ) {\n\t\t// Restore the viewer:\n\t\tthis.viewer = tmp;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default view;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar EventEmitter = require( 'events' ).EventEmitter;\nvar logger = require( 'debug' );\nimport objectKeys from '@stdlib/utils/keys';\nimport defineProperty from '@stdlib/utils/define-property';\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\nimport isObject from '@stdlib/assert/is-plain-object';\nimport copy from '@stdlib/utils/copy';\nimport inherit from '@stdlib/utils/inherit';\nimport { factory as mergeFcn } from '@stdlib/utils/merge';\nimport minstd from '@stdlib/random/base/minstd';\nimport format from '@stdlib/string/format';\nimport view from './view/view.js';\nimport defaults from './defaults.js';\nimport setX from './props/x/set.js';\nimport getX from './props/x/get.js';\nimport setY from './props/y/set.js';\nimport getY from './props/y/get.js';\nimport setLabels from './props/labels/set.js';\nimport getLabels from './props/labels/get.js';\nimport setIsDefined from './props/is-defined/set.js';\nimport getIsDefined from './props/is-defined/get.js';\nimport setColors from './props/colors/set.js';\nimport getColors from './props/colors/get.js';\nimport setLineStyle from './props/line-style/set.js';\nimport getLineStyle from './props/line-style/get.js';\nimport setLineOpacity from './props/line-opacity/set.js';\nimport getLineOpacity from './props/line-opacity/get.js';\nimport setLineWidth from './props/line-width/set.js';\nimport getLineWidth from './props/line-width/get.js';\nimport setSymbols from './props/symbols/set.js';\nimport getSymbols from './props/symbols/get.js';\nimport setSymbolsSize from './props/symbols-size/set.js';\nimport getSymbolsSize from './props/symbols-size/get.js';\nimport setSymbolsOpacity from './props/symbols-opacity/set.js';\nimport getSymbolsOpacity from './props/symbols-opacity/get.js';\nimport setWidth from './props/width/set.js';\nimport getWidth from './props/width/get.js';\nimport setHeight from './props/height/set.js';\nimport getHeight from './props/height/get.js';\nimport setPaddingLeft from './props/padding-left/set.js';\nimport getPaddingLeft from './props/padding-left/get.js';\nimport setPaddingRight from './props/padding-right/set.js';\nimport getPaddingRight from './props/padding-right/get.js';\nimport setPaddingTop from './props/padding-top/set.js';\nimport getPaddingTop from './props/padding-top/get.js';\nimport setPaddingBottom from './props/padding-bottom/set.js';\nimport getPaddingBottom from './props/padding-bottom/get.js';\nimport setXMin from './props/x-min/set.js';\nimport getXMin from './props/x-min/get.js';\nimport setXMax from './props/x-max/set.js';\nimport getXMax from './props/x-max/get.js';\nimport setYMin from './props/y-min/set.js';\nimport getYMin from './props/y-min/get.js';\nimport setYMax from './props/y-max/set.js';\nimport getYMax from './props/y-max/get.js';\nimport setXScale from './props/x-scale/set.js';\nimport getXScale from './props/x-scale/get.js';\nimport setYScale from './props/y-scale/set.js';\nimport getYScale from './props/y-scale/get.js';\nimport setXTickFormat from './props/x-tick-format/set.js';\nimport getXTickFormat from './props/x-tick-format/get.js';\nimport setYTickFormat from './props/y-tick-format/set.js';\nimport getYTickFormat from './props/y-tick-format/get.js';\nimport setXNumTicks from './props/x-num-ticks/set.js';\nimport getXNumTicks from './props/x-num-ticks/get.js';\nimport setYNumTicks from './props/y-num-ticks/set.js';\nimport getYNumTicks from './props/y-num-ticks/get.js';\nimport setXAxisOrient from './props/x-axis-orient/set.js';\nimport getXAxisOrient from './props/x-axis-orient/get.js';\nimport setYAxisOrient from './props/y-axis-orient/set.js';\nimport getYAxisOrient from './props/y-axis-orient/get.js';\nimport setXRug from './props/x-rug/set.js';\nimport getXRug from './props/x-rug/get.js';\nimport setYRug from './props/y-rug/set.js';\nimport getYRug from './props/y-rug/get.js';\nimport setXRugOrient from './props/x-rug-orient/set.js';\nimport getXRugOrient from './props/x-rug-orient/get.js';\nimport setYRugOrient from './props/y-rug-orient/set.js';\nimport getYRugOrient from './props/y-rug-orient/get.js';\nimport setXRugOpacity from './props/x-rug-opacity/set.js';\nimport getXRugOpacity from './props/x-rug-opacity/get.js';\nimport setYRugOpacity from './props/y-rug-opacity/set.js';\nimport getYRugOpacity from './props/y-rug-opacity/get.js';\nimport setXRugSize from './props/x-rug-size/set.js';\nimport getXRugSize from './props/x-rug-size/get.js';\nimport setYRugSize from './props/y-rug-size/set.js';\nimport getYRugSize from './props/y-rug-size/get.js';\nimport setDescription from './props/description/set.js';\nimport getDescription from './props/description/get.js';\nimport setTitle from './props/title/set.js';\nimport getTitle from './props/title/get.js';\nimport setXLabel from './props/x-label/set.js';\nimport getXLabel from './props/x-label/get.js';\nimport setYLabel from './props/y-label/set.js';\nimport getYLabel from './props/y-label/get.js';\nimport setEngine from './props/engine/set.js';\nimport getEngine from './props/engine/get.js';\nimport setAutoRender from './props/auto-render/set.js';\nimport getAutoRender from './props/auto-render/get.js';\nimport setRenderFormat from './props/render-format/set.js';\nimport getRenderFormat from './props/render-format/get.js';\nimport setViewer from './props/viewer/set.js';\nimport getViewer from './props/viewer/get.js';\nimport setAutoView from './props/auto-view/set.js';\nimport getAutoView from './props/auto-view/get.js';\nimport getGraphWidth from './props/graph-width/get.js';\nimport getGraphHeight from './props/graph-height/get.js';\nimport getXDomain from './props/x-domain/get.js';\nimport getYDomain from './props/y-domain/get.js';\nimport getXRange from './props/x-range/get.js';\nimport getYRange from './props/y-range/get.js';\nimport getXPos from './props/x-pos/get.js';\nimport getYPos from './props/y-pos/get.js';\nimport render from './render';\nimport viewMethod from './view';\n\n\n// VARIABLES //\n\nvar debug = logger( 'plot:main' );\nvar PRIVATE_PROPS = [\n\t'_autoRender',\n\t'_autoView',\n\t'_colors',\n\t'_description',\n\t'_engine',\n\t'_height',\n\t'_isDefined',\n\t'_labels',\n\t'_lineOpacity',\n\t'_lineStyle',\n\t'_lineWidth',\n\t'_paddingBottom',\n\t'_paddingLeft',\n\t'_paddingRight',\n\t'_paddingTop',\n\t'_renderFormat',\n\t'_symbols',\n\t'_symbolsOpacity',\n\t'_symbolsSize',\n\t'_title',\n\t'_viewer',\n\t'_width',\n\t'_xAxisOrient',\n\t'_xData',\n\t'_xLabel',\n\t'_xMax',\n\t'_xMin',\n\t'_xNumTicks',\n\t'_xRug',\n\t'_xRugOpacity',\n\t'_xRugOrient',\n\t'_xRugSize',\n\t'_xScale',\n\t'_xTickFormat',\n\t'_yAxisOrient',\n\t'_yData',\n\t'_yLabel',\n\t'_yMax',\n\t'_yMin',\n\t'_yNumTicks',\n\t'_yRug',\n\t'_yRugOpacity',\n\t'_yRugOrient',\n\t'_yRugSize',\n\t'_yScale',\n\t'_yTickFormat'\n];\n\n\n// FUNCTIONS //\n\nvar merge = mergeFcn({\n\t'extend': false\n});\n\n\n// MAIN //\n\n/**\n* Plot constructor.\n*\n* @constructor\n* @param {Array} [x] - x-values\n* @param {Array} [y] - y-values\n* @param {Options} [options] - constructor options\n* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a change event\n* @param {boolean} [options.autoView=false] - indicates whether to generate an updated view on a render event\n* @param {(string|StringArray)} [options.colors='category10'] - data colors\n* @param {string} [options.description=''] - plot description\n* @param {string} [options.engine='svg'] - plot engine\n* @param {PositiveNumber} [options.height=400] - plot height\n* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined\n* @param {(StringArray|EmptyArray)} [options.labels] - data labels\n* @param {(number|NumberArray)} [options.lineOpacity=0.9] - data line opacity\n* @param {(string|StringArray)} [options.lineStyle='-'] - data line style(s)\n* @param {(NonNegativeInteger|Array)} [options.lineWidth=2] - data line width(s)\n* @param {NonNegativeInteger} [options.paddingBottom=80] - bottom padding\n* @param {NonNegativeInteger} [options.paddingLeft=90] - left padding\n* @param {NonNegativeInteger} [options.paddingRight=20] - right padding\n* @param {NonNegativeInteger} [options.paddingTop=80] - top padding\n* @param {string} [options.renderFormat='vdom'] - plot render format\n* @param {(string|StringArray)} [options.symbols='none'] - data symbols\n* @param {(number|NumberArray)} [options.symbolsOpacity=0.9] - symbols opacity\n* @param {(NonNegativeInteger|Array)} [options.symbolsSize=6] - symbols size\n* @param {string} [options.title=''] - plot title\n* @param {string} [options.viewer='none'] - plot viewer\n* @param {PositiveNumber} [options.width=400] - plot width\n* @param {Array} [options.x=[]] - x-values\n* @param {string} [options.xAxisOrient='bottom'] - x-axis orientation\n* @param {string} [options.xLabel='x'] - x-axis label\n* @param {(Date|FiniteNumber|null)} [options.xMax=null] - maximum value of x-axis domain\n* @param {(Date|FiniteNumber|null)} [options.xMin=null] - minimum value of x-axis domain\n* @param {(NonNegativeInteger|null)} [options.xNumTicks=5] - number of x-axis tick marks\n* @param {(boolean|BooleanArray)} [options.xRug=false] - indicates whether to render a rug plot along the x-axis\n* @param {(string|StringArray)} [options.xRugOrient='bottom'] - x-axis rug orientation\n* @param {(number|NumberArray)} [options.xRugOpacity=0.1] - x-axis rug opacity\n* @param {(NonNegativeInteger|Array)} [options.xRugSize=6] - x-axis rug tick (tassel) size\n* @param {string} [options.xScale='linear'] - x-axis scale\n* @param {(string|null)} [options.xTickFormat=null] - x-axis tick format\n* @param {Array} [options.y=[]] - y-values\n* @param {string} [options.yAxisOrient='left'] - y-axis orientation\n* @param {string} [options.yLabel='y'] - y-axis label\n* @param {(FiniteNumber|null)} [options.yMax=null] - maximum value of y-axis domain\n* @param {(FiniteNumber|null)} [options.yMin=null] - minimum value of y-axis domain\n* @param {(NonNegativeInteger|null)} [options.yNumTicks=5] - number of y-axis tick marks\n* @param {(boolean|BooleanArray)} [options.yRug=false] - indicates whether to render a rug plot along the y-axis\n* @param {(string|StringArray)} [options.yRugOrient='left'] - y-axis rug orientation\n* @param {(number|NumberArray)} [options.yRugOpacity=0.1] - y-axis rug opacity\n* @param {(NonNegativeInteger|Array)} [options.yRugSize=6] - y-axis rug tick (tassel) size\n* @param {string} [options.yScale='linear'] - y-axis scale\n* @param {(string|null)} [options.yTickFormat=null] - y-axis tick format\n* @throws {TypeError} must provide valid options\n* @returns {Plot} Plot instance\n*\n* @example\n* var plot = new Plot();\n*/\nfunction Plot() {\n\tvar options;\n\tvar nargs;\n\tvar keys;\n\tvar self;\n\tvar opts;\n\tvar key;\n\tvar i;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Plot) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Plot();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Plot( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Plot( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Plot( arguments[0], arguments[1], arguments[2] );\n\t}\n\tself = this;\n\n\topts = defaults();\n\tif ( nargs === 0 ) {\n\t\toptions = {};\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t} else if ( nargs === 2 ) {\n\t\toptions = {\n\t\t\t'x': arguments[ 0 ],\n\t\t\t'y': arguments[ 1 ]\n\t\t};\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isObject( arguments[2] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', arguments[2] ) );\n\t\t}\n\t\toptions = copy( arguments[2] ); // avoid mutation\n\t\toptions.x = arguments[ 0 ];\n\t\toptions.y = arguments[ 1 ];\n\t}\n\topts = merge( opts, options );\n\n\tdebug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) );\n\tEventEmitter.call( this );\n\n\tfor ( i = 0; i < PRIVATE_PROPS.length; i++ ) {\n\t\tdefineProperty( this, PRIVATE_PROPS[i], {\n\t\t\t'configurable': false,\n\t\t\t'enumerable': false,\n\t\t\t'writable': true,\n\t\t\t'value': null\n\t\t});\n\t}\n\t// Set a clipping path id:\n\tdefineProperty( this, '_clipPathId', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': minstd().toString() // TODO: uuid\n\t});\n\n\t// Initialize an internal cache for renderers...\n\tdefineProperty( this, '$', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': {}\n\t});\n\tdefineProperty( this.$, 'svg', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': {}\n\t});\n\n\t// Set options...\n\tkeys = objectKeys( opts );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tthis[ key ] = opts[ key ];\n\t}\n\n\t// Add event listeners:\n\tthis.on( 'change', onChange );\n\tthis.on( 'render', onRender );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a change event.\n\t*\n\t* @private\n\t*/\n\tfunction onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\tdebug( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked upon receiving a render event.\n\t*\n\t* @private\n\t* @param {*} plot - rendered plot\n\t*/\n\tfunction onRender( plot ) {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\tdebug( 'Received a render event.' );\n\t\tif ( self._autoView ) {\n\t\t\tdebug( 'Viewer: %s.', self._viewer );\n\t\t\tdebug( 'Generating view...' );\n\t\t\tview( self, self._viewer, plot );\n\t\t}\n\t}\n}\n\n/*\n* Inherit from the `EventEmitter` prototype.\n*/\ninherit( Plot, EventEmitter );\n\n/**\n* `x` values.\n*\n* @name x\n* @memberof Plot.prototype\n* @type {Array}\n* @throws {TypeError} must be an array\n* @default []\n*\n* @example\n* var plot = new Plot();\n* plot.x = [ [ 1417563950959, 1417563952959 ] ];\n*\n* @example\n* var plot = new Plot({\n* 'x': [ [ 1417563950959, 1417563952959 ] ]\n* });\n* var x = plot.x;\n* // returns [ [ 1417563950959, 1417563952959 ] ]\n*/\ndefineProperty( Plot.prototype, 'x', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setX,\n\t'get': getX\n});\n\n/**\n* `y` values.\n*\n* @name y\n* @memberof Plot.prototype\n* @type {Array}\n* @throws {TypeError} must be an array\n* @default []\n*\n* @example\n* var plot = new Plot();\n* plot.x = [ [ 1417563950959, 1417563952959 ] ];\n* plot.y = [ [ 0.25, 0.23 ] ];\n*\n* @example\n* var plot = new Plot({\n* 'x': [ [ 1417563950959, 1417563952959 ] ],\n* 'y': [ [ 0.25, 0.23 ] ]\n* });\n* var y = plot.y;\n* // returns [ [ 0.25, 0.23 ] ]\n*/\ndefineProperty( Plot.prototype, 'y', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setY,\n\t'get': getY\n});\n\n/**\n* Data labels.\n*\n* @name labels\n* @memberof Plot.prototype\n* @type {(StringArray|EmptyArray)}\n* @throws {TypeError} must be either an array of strings or an empty array\n* @default []\n*\n* @example\n* var plot = new Plot();\n* plot.labels = [ 'beep', 'boop' ];\n*\n* @example\n* var plot = new Plot({\n* 'labels': [ 'beep', 'boop' ]\n* });\n* var labels = plot.labels;\n* // returns [ 'beep', 'boop' ]\n*/\ndefineProperty( Plot.prototype, 'labels', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLabels,\n\t'get': getLabels\n});\n\n/**\n* Accessor which defines whether a datum is defined.\n*\n* ## Notes\n*\n* - This accessor is used to define how missing values are encoded.\n* - The default behavior is to ignore values which are `NaN`.\n*\n* @name isDefined\n* @memberof Plot.prototype\n* @type {Function}\n* @param {*} d - datum\n* @param {integer} i - index\n* @throws {TypeError} must be a function\n*\n* @example\n* var plot = new Plot();\n* plot.isDefined = function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n*\n* @example\n* function isDefined( d ) {\n* // Check for `NaN`:\n* return ( d === d );\n* }\n* var plot = new Plot({\n* 'isDefined': isDefined\n* });\n* var fcn = plot.isDefined;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'isDefined', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setIsDefined,\n\t'get': getIsDefined\n});\n\n/**\n* Data colors. When retrieved, the returned value is always an `array`.\n*\n* @name colors\n* @memberof Plot.prototype\n* @type {(string|StringArray)}\n* @throws {TypeError} must be either a string or an array of strings\n* @default 'category10'\n*\n* @example\n* var plot = new Plot();\n* plot.colors = 'category20';\n*\n* @example\n* var plot = new Plot({\n* 'colors': 'category20'\n* });\n* var colors = plot.colors;\n* // returns [...]\n*/\ndefineProperty( Plot.prototype, 'colors', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setColors,\n\t'get': getColors\n});\n\n/**\n* Data line style(s).\n*\n* ## Notes\n*\n* - When retrieved, the returned value is always an `array`.\n*\n* @name lineStyle\n* @memberof Plot.prototype\n* @type {(string|StringArray)}\n* @throws {TypeError} must be a string or string array\n* @throws {Error} must be a supported line style\n* @default '-'\n*\n* @example\n* var plot = new Plot();\n* plot.lineStyle = [ '-', 'none' ];\n*\n* @example\n* var plot = new Plot({\n* 'lineStyle': 'none'\n* });\n* var lineStyle = plot.lineStyle;\n* // returns [ 'none' ]\n*/\ndefineProperty( Plot.prototype, 'lineStyle', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLineStyle,\n\t'get': getLineStyle\n});\n\n/**\n* Data line opacity.\n*\n* ## Notes\n*\n* - When retrieved, the returned value is always an `array`.\n*\n* @name lineOpacity\n* @memberof Plot.prototype\n* @type {(number|NumberArray)}\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default '0.9'\n*\n* @example\n* var plot = new Plot();\n* plot.lineOpacity = [ 1.0, 0.5 ];\n*\n* @example\n* var plot = new Plot({\n* 'lineOpacity': 0.5\n* });\n* var opacity = plot.lineOpacity;\n* // returns [ 0.5 ]\n*/\ndefineProperty( Plot.prototype, 'lineOpacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLineOpacity,\n\t'get': getLineOpacity\n});\n\n/**\n* Data line width.\n*\n* ## Notes\n*\n* - When retrieved, the returned value is always an `array`.\n*\n* @name lineWidth\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|NonNegativeIntegerArray)}\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @default 2\n*\n* @example\n* var plot = new Plot();\n* plot.lineWidth = 1;\n*\n* @example\n* var plot = new Plot({\n* 'lineWidth': [ 1, 3 ]\n* });\n* var width = plot.lineWidth;\n* // returns [ 1, 3 ]\n*/\ndefineProperty( Plot.prototype, 'lineWidth', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setLineWidth,\n\t'get': getLineWidth\n});\n\n/**\n* Data symbols. When retrieved, the returned value is always an `array`.\n*\n* @name symbols\n* @memberof Plot.prototype\n* @type {(string|StringArray)}\n* @throws {TypeError} must be a string or string array\n* @throws {Error} must be a supported symbol\n* @default 'none'\n*\n* @example\n* var plot = new Plot();\n* plot.symbols = [ 'open-circle', 'closed-circle' ];\n*\n* @example\n* var plot = new Plot({\n* 'symbols': 'closed-circle'\n* });\n* var symbols = plot.symbols;\n* // returns [ 'closed-circle' ]\n*/\ndefineProperty( Plot.prototype, 'symbols', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSymbols,\n\t'get': getSymbols\n});\n\n/**\n* Symbols size. When retrieved, the returned value is always an `array`.\n*\n* @name symbolsSize\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|NonNegativeIntegerArray)}\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @default 6\n*\n* @example\n* var plot = new Plot();\n* plot.symbolsSize = 4;\n*\n* @example\n* var plot = new Plot({\n* 'symbolsSize': [ 4, 6 ]\n* });\n* var size = plot.symbolsSize;\n* // returns [ 4, 6 ]\n*/\ndefineProperty( Plot.prototype, 'symbolsSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSymbolsSize,\n\t'get': getSymbolsSize\n});\n\n/**\n* Symbols opacity. When retrieved, the returned value is always an `array`.\n*\n* @name symbolsOpacity\n* @memberof Plot.prototype\n* @type {(number|NumberArray)}\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.9\n*\n* @example\n* var plot = new Plot();\n* plot.symbolsOpacity = [ 0.2, 0.5 ];\n*\n* @example\n* var plot = new Plot({\n* 'symbolsOpacity': 0.2\n* });\n* var opacity = plot.symbolsOpacity;\n* // returns [ 0.2 ]\n*/\ndefineProperty( Plot.prototype, 'symbolsOpacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setSymbolsOpacity,\n\t'get': getSymbolsOpacity\n});\n\n/**\n* Plot width.\n*\n* @name width\n* @memberof Plot.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.width = 100;\n*\n* @example\n* var plot = new Plot({\n* 'width': 480\n* });\n* var width = plot.width;\n* // returns 480\n*/\ndefineProperty( Plot.prototype, 'width', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setWidth,\n\t'get': getWidth\n});\n\n/**\n* Plot height.\n*\n* @name height\n* @memberof Plot.prototype\n* @type {PositiveNumber}\n* @throws {TypeError} must be a positive number\n* @default 400 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.height = 100;\n*\n* @example\n* var plot = new Plot({\n* 'height': 360\n* });\n* var height = plot.height;\n* // returns 360\n*/\ndefineProperty( Plot.prototype, 'height', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setHeight,\n\t'get': getHeight\n});\n\n/**\n* Plot left padding.\n*\n* ## Notes\n*\n* - Typically used to create space for a left-oriented y-axis.\n*\n* @name paddingLeft\n* @memberof Plot.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 90 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.paddingLeft = 100;\n*\n* @example\n* var plot = new Plot({\n* 'paddingLeft': 100\n* });\n* var padding = plot.paddingLeft;\n* // returns 100\n*/\ndefineProperty( Plot.prototype, 'paddingLeft', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setPaddingLeft,\n\t'get': getPaddingLeft\n});\n\n/**\n* Plot right padding.\n*\n* ## Notes\n*\n* - Typically used to create space for a right-oriented y-axis.\n*\n* @name paddingRight\n* @memberof Plot.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 20 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.paddingRight = 100;\n*\n* @example\n* var plot = new Plot({\n* 'paddingRight': 100\n* });\n* var padding = plot.paddingRight;\n* // returns 100\n*/\ndefineProperty( Plot.prototype, 'paddingRight', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setPaddingRight,\n\t'get': getPaddingRight\n});\n\n/**\n* Plot top padding.\n*\n* ## Notes\n*\n* - Typically used to create space for a title or top-oriented x-axis.\n*\n* @name paddingTop\n* @memberof Plot.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 80 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.paddingTop = 100;\n*\n* @example\n* var plot = new Plot({\n* 'paddingTop': 100\n* });\n* var padding = plot.paddingTop;\n* // returns 100\n*/\ndefineProperty( Plot.prototype, 'paddingTop', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setPaddingTop,\n\t'get': getPaddingTop\n});\n\n/**\n* Plot bottom padding.\n*\n* ## Notes\n*\n* - Typically used to create space for a bottom-oriented y-axis.\n*\n* @name paddingBottom\n* @memberof Plot.prototype\n* @type {NonNegativeInteger}\n* @throws {TypeError} must be a nonnegative integer\n* @default 80 (px)\n*\n* @example\n* var plot = new Plot();\n* plot.paddingBottom = 100;\n*\n* @example\n* var plot = new Plot({\n* 'paddingBottom': 100\n* });\n* var padding = plot.paddingBottom;\n* // returns 100\n*/\ndefineProperty( Plot.prototype, 'paddingBottom', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setPaddingBottom,\n\t'get': getPaddingBottom\n});\n\n/**\n* Minimum value of the x-axis domain.\n*\n* ## Notes\n*\n* - When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data.\n*\n* @name xMin\n* @memberof Plot.prototype\n* @type {(FiniteNumber|null)}\n* @throws {TypeError} must be a finite number or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.xMin = -1.0;\n*\n* @example\n* var plot = new Plot({\n* 'xMin': -10.0\n* });\n* var xmin = plot.xMin;\n* // returns -10.0\n*/\ndefineProperty( Plot.prototype, 'xMin', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXMin,\n\t'get': getXMin\n});\n\n/**\n* Maximum value of the x-axis domain.\n*\n* ## Notes\n*\n* - When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data.\n*\n* @name xMax\n* @memberof Plot.prototype\n* @type {(FiniteNumber|null)}\n* @throws {TypeError} must be a finite number or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.xMax = 100.0;\n*\n* @example\n* var plot = new Plot({\n* 'xMax': 10.0\n* });\n* var xmax = plot.xMax;\n* // returns 10.0\n*/\ndefineProperty( Plot.prototype, 'xMax', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXMax,\n\t'get': getXMax\n});\n\n/**\n* Minimum value of the y-axis domain.\n*\n* ## Notes\n*\n* - When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data.\n*\n* @name yMin\n* @memberof Plot.prototype\n* @type {(FiniteNumber|null)}\n* @throws {TypeError} must be a finite number or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.yMin = -100.0;\n*\n* @example\n* var plot = new Plot({\n* 'yMin': 3.14\n* });\n* var ymin = plot.yMin;\n* // returns 3.14\n*/\ndefineProperty( Plot.prototype, 'yMin', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYMin,\n\t'get': getYMin\n});\n\n/**\n* Maximum value of the y-axis domain.\n*\n* ## Notes\n*\n* - When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data.\n*\n* @name yMax\n* @memberof Plot.prototype\n* @type {(FiniteNumber|null)}\n* @throws {TypeError} must be a finite number or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.yMax = 100.0;\n*\n* @example\n* var plot = new Plot({\n* 'yMax': 31.4\n* });\n* var ymax = plot.yMax;\n* // returns 31.4\n*/\ndefineProperty( Plot.prototype, 'yMax', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYMax,\n\t'get': getYMax\n});\n\n/**\n* Scale function for mapping values to a coordinate along the x-axis. When retrieved, the returned value is a scale function.\n*\n* @name xScale\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default 'linear'\n*\n* @example\n* var plot = new Plot();\n* plot.xScale = 'time';\n*\n* @example\n* var plot = new Plot({\n* 'xScale': 'time'\n* });\n* var scale = plot.xScale;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'xScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXScale,\n\t'get': getXScale\n});\n\n/**\n* Scale function for mapping values to a coordinate along the y-axis. When retrieved, the returned value is a scale function.\n*\n* @name yScale\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default 'linear'\n*\n* @example\n* var plot = new Plot();\n* plot.yScale = 'linear';\n*\n* @example\n* var plot = new Plot({\n* 'yScale': 'linear'\n* });\n* var scale = plot.yScale;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'yScale', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYScale,\n\t'get': getYScale\n});\n\n/**\n* x-axis tick format.\n*\n* ## Notes\n*\n* - When retrieved, if the value is not `null`, the returned value is a formatting function.\n*\n* @name xTickFormat\n* @memberof Plot.prototype\n* @type {(string|null)}\n* @throws {TypeError} must be a string or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.xScale = 'time';\n* plot.xTickFormat = '%H:%M';\n*\n* @example\n* var plot = new Plot({\n* 'xScale': 'time',\n* 'xTickFormat': '%H:%M'\n* });\n* var fmt = plot.xTickFormat;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'xTickFormat', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXTickFormat,\n\t'get': getXTickFormat\n});\n\n/**\n* y-axis tick format.\n*\n* ## Notes\n*\n* - If the value is not `null`, when retrieved, the returned value is a formatting function.\n*\n* @name yTickFormat\n* @memberof Plot.prototype\n* @type {(string|null)}\n* @throws {TypeError} must be a string or null\n* @default null\n*\n* @example\n* var plot = new Plot();\n* plot.yTickFormat = '.0%';\n*\n* @example\n* var plot = new Plot({\n* 'yTickFormat': '.0%'\n* });\n* var fmt = plot.yTickFormat;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'yTickFormat', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYTickFormat,\n\t'get': getYTickFormat\n});\n\n/**\n* Number of x-axis tick marks.\n*\n* @name xNumTicks\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|null)}\n* @throws {TypeError} must be a nonnegative integer or null\n* @default 5\n*\n* @example\n* var plot = new Plot();\n* plot.xNumTicks = 10;\n*\n* @example\n* var plot = new Plot({\n* 'xNumTicks': 10\n* });\n* var ticks = plot.xNumTicks;\n* // returns 10\n*/\ndefineProperty( Plot.prototype, 'xNumTicks', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXNumTicks,\n\t'get': getXNumTicks\n});\n\n/**\n* Number of y-axis tick marks.\n*\n* @name yNumTicks\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|null)}\n* @throws {TypeError} must be a nonnegative integer or null\n* @default 5\n*\n* @example\n* var plot = new Plot();\n* plot.yNumTicks = 10;\n*\n* @example\n* var plot = new Plot({\n* 'yNumTicks': 10\n* });\n* var ticks = plot.yNumTicks;\n* // returns 10\n*/\ndefineProperty( Plot.prototype, 'yNumTicks', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYNumTicks,\n\t'get': getYNumTicks\n});\n\n/**\n* x-axis orientation.\n*\n* @name xAxisOrient\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be either `'top'` or `'bottom'`\n* @default 'bottom'\n*\n* @example\n* var plot = new Plot();\n* plot.xAxisOrient = 'bottom';\n*\n* @example\n* var plot = new Plot({\n* 'xAxisOrient': 'bottom'\n* });\n* var orientation = plot.xAxisOrient;\n* // returns 'bottom'\n*/\ndefineProperty( Plot.prototype, 'xAxisOrient', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXAxisOrient,\n\t'get': getXAxisOrient\n});\n\n/**\n* y-axis orientation.\n*\n* @name yAxisOrient\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be either `'left'` or `'right'`\n* @default 'left'\n*\n* @example\n* var plot = new Plot();\n* plot.yAxisOrient = 'left';\n*\n* @example\n* var plot = new Plot({\n* 'yAxisOrient': 'left'\n* });\n* var orientation = plot.yAxisOrient;\n* // returns 'left'\n*/\ndefineProperty( Plot.prototype, 'yAxisOrient', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYAxisOrient,\n\t'get': getYAxisOrient\n});\n\n/**\n* Boolean flag(s) indicating whether to display a rug plot along the x-axis. When retrieved, the returned value is always an `array`.\n*\n* @name xRug\n* @memberof Plot.prototype\n* @type {(boolean|BooleanArray)}\n* @throws {TypeError} must be a boolean or boolean array\n* @default false\n*\n* @example\n* var plot = new Plot({\n* 'xRug': true\n* });\n*\n* var bool = plot.xRug;\n* // returns [ true ]\n*/\ndefineProperty( Plot.prototype, 'xRug', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXRug,\n\t'get': getXRug\n});\n\n/**\n* Boolean flag(s) indicating whether to display a rug plot along the y-axis. When retrieved, the returned value is always an `array`.\n*\n* @name yRug\n* @memberof Plot.prototype\n* @type {(boolean|BooleanArray)}\n* @throws {TypeError} must be a boolean or boolean array\n* @default false\n*\n* @example\n* var plot = new Plot({\n* 'yRug': true\n* });\n*\n* var bool = plot.yRug;\n* // returns [ true ]\n*/\ndefineProperty( Plot.prototype, 'yRug', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYRug,\n\t'get': getYRug\n});\n\n/**\n* x-axis rug orientation. When retrieved, the returned value is always an `array`.\n*\n* @name xRugOrient\n* @memberof Plot.prototype\n* @type {(string|StringArray)}\n* @throws {TypeError} must be a string or string array\n* @throws {TypeError} must be either `'top'` or `'bottom'`\n* @default 'bottom'\n*\n* @example\n* var plot = new Plot();\n* plot.xRugOrient = [ 'bottom', 'top' ];\n*\n* @example\n* var plot = new Plot({\n* 'xRugOrient': 'bottom'\n* });\n* var orientation = plot.xRugOrient;\n* // returns [ 'bottom' ]\n*/\ndefineProperty( Plot.prototype, 'xRugOrient', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXRugOrient,\n\t'get': getXRugOrient\n});\n\n/**\n* y-axis rug orientation. When retrieved, the returned value is always an `array`.\n*\n* @name yRugOrient\n* @memberof Plot.prototype\n* @type {(string|StringArray)}\n* @throws {TypeError} must be a string or string array\n* @throws {TypeError} must be either `'left'` or `'right'`\n* @default 'left'\n*\n* @example\n* var plot = new Plot();\n* plot.yRugOrient = [ 'right', 'left' ];\n*\n* @example\n* var plot = new Plot({\n* 'yRugOrient': 'left'\n* });\n* var orientation = plot.yRugOrient;\n* // returns [ 'left' ]\n*/\ndefineProperty( Plot.prototype, 'yRugOrient', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYRugOrient,\n\t'get': getYRugOrient\n});\n\n/**\n* x-axis rug opacity. When retrieved, the returned value is always an `array`.\n*\n* @name xRugOpacity\n* @memberof Plot.prototype\n* @type {(number|NumberArray)}\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.1\n*\n* @example\n* var plot = new Plot();\n* plot.xRugOpacity = [ 0.1, 0.5 ];\n*\n* @example\n* var plot = new Plot({\n* 'xRugOpacity': 0.1\n* });\n* var opacity = plot.xRugOpacity;\n* // returns [ 0.1 ]\n*/\ndefineProperty( Plot.prototype, 'xRugOpacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXRugOpacity,\n\t'get': getXRugOpacity\n});\n\n/**\n* y-axis rug opacity. When retrieved, the returned value is always an `array`.\n*\n* @name yRugOpacity\n* @memberof Plot.prototype\n* @type {(number|NumberArray)}\n* @throws {TypeError} must be a number or number array\n* @throws {RangeError} must be a number on the interval `[0,1]`\n* @default 0.1\n*\n* @example\n* var plot = new Plot();\n* plot.yRugOpacity = [ 0.1, 0.5 ];\n*\n* @example\n* var plot = new Plot({\n* 'yRugOpacity': 0.1\n* });\n* var opacity = plot.yRugOpacity;\n* // returns [ 0.1 ]\n*/\ndefineProperty( Plot.prototype, 'yRugOpacity', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYRugOpacity,\n\t'get': getYRugOpacity\n});\n\n/**\n* x-axis rug tick (tassel) size. When retrieved, the returned value is always an `array`.\n*\n* @name xRugSize\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|Array)}\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @default 6\n*\n* @example\n* var plot = new Plot();\n* plot.xRugSize = [ 4, 6 ];\n*\n* @example\n* var plot = new Plot({\n* 'xRugSize': 4\n* });\n* var size = plot.xRugSize;\n* // returns [ 4 ]\n*/\ndefineProperty( Plot.prototype, 'xRugSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXRugSize,\n\t'get': getXRugSize\n});\n\n/**\n* y-axis rug tick (tassel) size. When retrieved, the returned value is always an `array`.\n*\n* @name yRugSize\n* @memberof Plot.prototype\n* @type {(NonNegativeInteger|Array)}\n* @throws {TypeError} must be a nonnegative integer or nonnegative integer array\n* @default 6\n*\n* @example\n* var plot = new Plot();\n* plot.yRugSize = [ 4, 6 ];\n*\n* @example\n* var plot = new Plot({\n* 'yRugSize': 4\n* });\n* var size = plot.yRugSize;\n* // returns [ 4 ]\n*/\ndefineProperty( Plot.prototype, 'yRugSize', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYRugSize,\n\t'get': getYRugSize\n});\n\n/**\n* Plot description.\n*\n* @name description\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default ''\n*\n* @example\n* var plot = new Plot();\n* plot.description = 'Average stock market index covering the last 100 years.';\n*\n* @example\n* var plot = new Plot({\n* 'description': 'A plot description.'\n* });\n* var desc = plot.description;\n* // returns 'A plot description.'\n*/\ndefineProperty( Plot.prototype, 'description', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setDescription,\n\t'get': getDescription\n});\n\n/**\n* Plot title.\n*\n* @name title\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default ''\n*\n* @example\n* var plot = new Plot();\n* plot.title = 'Time Series';\n*\n* @example\n* var plot = new Plot({\n* 'title': 'Time Series'\n* });\n* var t = plot.title;\n* // returns 'Time Series'\n*/\ndefineProperty( Plot.prototype, 'title', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setTitle,\n\t'get': getTitle\n});\n\n/**\n* x-axis label.\n*\n* @name xLabel\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default 'x'\n*\n* @example\n* var plot = new Plot();\n* plot.xLabel = 'time';\n*\n* @example\n* var plot = new Plot({\n* 'xLabel': 'time'\n* });\n* var xLabel = plot.xLabel;\n* // returns 'time'\n*/\ndefineProperty( Plot.prototype, 'xLabel', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setXLabel,\n\t'get': getXLabel\n});\n\n/**\n* y-axis label.\n*\n* @name yLabel\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a string\n* @default 'y'\n*\n* @example\n* var plot = new Plot();\n* plot.yLabel = 'value';\n*\n* @example\n* var plot = new Plot({\n* 'yLabel': 'value'\n* });\n* var yLabel = plot.yLabel;\n* // returns 'value'\n*/\ndefineProperty( Plot.prototype, 'yLabel', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setYLabel,\n\t'get': getYLabel\n});\n\n/**\n* Plot engine.\n*\n* @name engine\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a recognized engine\n* @default 'svg'\n*\n* @example\n* var plot = new Plot();\n* plot.engine = 'svg';\n*\n* @example\n* var plot = new Plot({\n* 'engine': 'svg'\n* });\n* var engine = plot.engine;\n* // returns 'svg'\n*/\ndefineProperty( Plot.prototype, 'engine', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setEngine,\n\t'get': getEngine\n});\n\n/**\n* Rendering mode.\n*\n* ## Notes\n*\n* - If `true`, an instance re-renders on each change event.\n*\n* @name autoRender\n* @memberof Plot.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var plot = new Plot({\n* 'autoRender': true\n* });\n*\n* var mode = plot.autoRender;\n* // returns true\n*/\ndefineProperty( Plot.prototype, 'autoRender', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoRender,\n\t'get': getAutoRender\n});\n\n/**\n* Plot render format.\n*\n* @name renderFormat\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a recognized format\n* @default 'vdom'\n*\n* @example\n* var plot = new Plot();\n* plot.renderFormat = 'vdom';\n*\n* @example\n* var plot = new Plot({\n* 'renderFormat': 'html'\n* });\n* var fmt = plot.renderFormat;\n* // returns 'html'\n*/\ndefineProperty( Plot.prototype, 'renderFormat', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setRenderFormat,\n\t'get': getRenderFormat\n});\n\n/**\n* Plot viewer.\n*\n* @name viewer\n* @memberof Plot.prototype\n* @type {string}\n* @throws {TypeError} must be a recognized viewer\n* @default 'none'\n*\n* @example\n* var plot = new Plot();\n* plot.viewer = 'none';\n*\n* @example\n* var plot = new Plot({\n* 'viewer': 'none'\n* });\n* var viewer = plot.viewer;\n* // returns 'none'\n*/\ndefineProperty( Plot.prototype, 'viewer', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setViewer,\n\t'get': getViewer\n});\n\n/**\n* Viewer mode. If `true`, an instance generates an updated view on each render event.\n*\n* @name autoView\n* @memberof Plot.prototype\n* @type {boolean}\n* @throws {TypeError} must be a boolean\n* @default false\n*\n* @example\n* var plot = new Plot({\n* 'autoView': false\n* });\n*\n* var mode = plot.autoView;\n* // returns false\n*/\ndefineProperty( Plot.prototype, 'autoView', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'set': setAutoView,\n\t'get': getAutoView\n});\n\n/**\n* Expected graph width.\n*\n* @name graphWidth\n* @memberof Plot.prototype\n* @type {number}\n*\n* @example\n* var plot = new Plot({\n* 'width': 100,\n* 'paddingLeft': 10,\n* 'paddingRight': 10\n* });\n* var width = plot.graphWidth;\n* // returns 80\n*/\ndefineProperty( Plot.prototype, 'graphWidth', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getGraphWidth\n});\n\n/**\n* Expected graph height.\n*\n* @name graphHeight\n* @memberof Plot.prototype\n* @type {number}\n*\n* @example\n* var plot = new Plot({\n* 'height': 100,\n* 'paddingTop': 10,\n* 'paddingBottom': 20\n* });\n* var height = plot.graphHeight;\n* // returns 70\n*/\ndefineProperty( Plot.prototype, 'graphHeight', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getGraphHeight\n});\n\n/**\n* x-axis domain.\n*\n* @name xDomain\n* @memberof Plot.prototype\n* @type {Array}\n*\n* @example\n* var plot = new Plot({\n* 'xMin': 0,\n* 'xMax': 100\n* });\n* var domain = plot.xDomain;\n* // returns [ 0, 100 ]\n*/\ndefineProperty( Plot.prototype, 'xDomain', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getXDomain\n});\n\n/**\n* y-axis domain.\n*\n* @name yDomain\n* @memberof Plot.prototype\n* @type {NumberArray}\n*\n* @example\n* var plot = new Plot({\n* 'yMin': 0,\n* 'yMax': 100\n* });\n* var domain = plot.yDomain;\n* // returns [ 0, 100 ]\n*/\ndefineProperty( Plot.prototype, 'yDomain', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getYDomain\n});\n\n/**\n* x-axis range.\n*\n* @name xRange\n* @memberof Plot.prototype\n* @type {NumberArray}\n*\n* @example\n* var plot = new Plot({\n* 'width': 100,\n* 'paddingLeft': 10,\n* 'paddingRight': 10\n* });\n* var range = plot.xRange;\n* // returns [ 0, 80 ]\n*/\ndefineProperty( Plot.prototype, 'xRange', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getXRange\n});\n\n/**\n* y-axis range.\n*\n* @name yRange\n* @memberof Plot.prototype\n* @type {NumberArray}\n*\n* @example\n* var plot = new Plot({\n* 'height': 100,\n* 'paddingTop': 10,\n* 'paddingBottom': 20\n* });\n* var range = plot.yRange;\n* // returns [ 70, 0 ]\n*/\ndefineProperty( Plot.prototype, 'yRange', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getYRange\n});\n\n/**\n* Function to map values to x-axis coordinate values.\n*\n* @name xPos\n* @memberof Plot.prototype\n* @type {Function}\n*\n* @example\n* var plot = new Plot();\n* var xPos = plot.xPos;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'xPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getXPos\n});\n\n/**\n* Function to map values to y-axis coordinate values.\n*\n* @name yPos\n* @memberof Plot.prototype\n* @type {Function}\n*\n* @example\n* var plot = new Plot();\n* var yPos = plot.yPos;\n* // returns \n*/\ndefineProperty( Plot.prototype, 'yPos', {\n\t'configurable': false,\n\t'enumerable': true,\n\t'get': getYPos\n});\n\n/**\n* Renders a plot.\n*\n* @name render\n* @memberof Plot.prototype\n* @type {Function}\n* @param {string} [format] - render format\n* @throws {TypeError} must provide a recognized format\n* @returns {(VTree|string)} virtual tree or string\n*\n* @example\n* var plot = new Plot();\n* plot.x = [ [ 1, 2, 3 ] ];\n* plot.y = [ [ 1, 0, 1 ] ];\n*\n* var out = plot.render();\n*\n* @example\n* var plot = new Plot();\n* plot.x = [ [ 1, 2, 3 ] ];\n* plot.y = [ [ 1, 0, 1 ] ];\n*\n* var out = plot.render( 'html' );\n*/\nsetReadOnly( Plot.prototype, 'render', render );\n\n/**\n* Generates a plot view.\n*\n* @name view\n* @memberof Plot.prototype\n* @type {Function}\n* @param {string} [viewer]\n* @throws {TypeError} must provide a recognized viewer\n*\n* @example\n* var plot = new Plot();\n* plot.x = [ [ 1, 2, 3 ] ];\n* plot.y = [ [ 1, 0, 1 ] ];\n*\n* plot.view( 'stdout' );\n*/\nsetReadOnly( Plot.prototype, 'view', viewMethod );\n\n\n// EXPORTS //\n\nexport default Plot;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNodeREPL from '@stdlib/assert/is-node-repl';\nimport isDefined from './accessors/is_defined.js';\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\tvar isREPL;\n\tvar o;\n\n\tisREPL = isNodeREPL();\n\to = {};\n\n\t// Boolean indicating whether to re-render on a change event:\n\to.autoRender = false;\n\n\t// Boolean indicating whether to generate an updated view on a render event:\n\to.autoView = false;\n\n\t// Data colors:\n\to.colors = 'category10';\n\n\t// Plot description:\n\to.description = '';\n\n\t// Plot engine:\n\to.engine = 'svg';\n\n\t// Plot height:\n\to.height = 400; // px\n\n\t// Accessor indicating whether a datum is defined:\n\to.isDefined = isDefined;\n\n\t// Data labels:\n\to.labels = [];\n\n\t// Data line opacity:\n\to.lineOpacity = 0.9; // [0,1]\n\n\t// Data line style(s):\n\to.lineStyle = '-';\n\n\t// Data line width(s):\n\to.lineWidth = 2; // px\n\n\t// FIXME: padding props depend on orientation (may require using `null` to flag)\n\n\t// Bottom padding:\n\to.paddingBottom = 80; // px\n\n\t// Left padding:\n\to.paddingLeft = 90; // px\n\n\t// Right padding:\n\to.paddingRight = 20; // px\n\n\t// Top padding:\n\to.paddingTop = 80; // px\n\n\t// Render format:\n\to.renderFormat = 'vdom';\n\n\t// Data symbols:\n\to.symbols = 'none';\n\n\t// Symbols opacity:\n\to.symbolsOpacity = 0.9; // [0,1]\n\n\t// Symbols size:\n\to.symbolsSize = 6; // px\n\n\t// Plot title:\n\to.title = '';\n\n\t// Plot viewer:\n\tif ( isREPL ) {\n\t\to.viewer = 'window';\n\t} else {\n\t\to.viewer = 'none';\n\t}\n\t// Plot width:\n\to.width = 400; // px\n\n\t// x-values:\n\to.x = [];\n\n\t// x-axis orientation:\n\to.xAxisOrient = 'bottom';\n\n\t// x-axis label:\n\to.xLabel = 'x';\n\n\t// Maximum value of x-axis domain:\n\to.xMax = null;\n\n\t// Minimum value of x-axis domain:\n\to.xMin = null;\n\n\t// Number of x-axis tick marks:\n\to.xNumTicks = 5;\n\n\t// Boolean indicating whether to render a rug plot along the x-axis:\n\to.xRug = false;\n\n\t// x-axis rug orientation:\n\to.xRugOrient = 'bottom';\n\n\t// x-axis rug opacity:\n\to.xRugOpacity = 0.1; // [0,1]\n\n\t// x-axis rug tick (tassel) size:\n\to.xRugSize = 6; // px\n\n\t// x-axis scale:\n\to.xScale = 'linear';\n\n\t// x-axis tick format:\n\to.xTickFormat = null;\n\n\t// y-values:\n\to.y = [];\n\n\t// y-axis orientation:\n\to.yAxisOrient = 'left';\n\n\t// y-axis label:\n\to.yLabel = 'y';\n\n\t// Maximum value of y-axis domain:\n\to.yMax = null;\n\n\t// Minimum value of y-axis domain:\n\to.yMin = null;\n\n\t// Number of y-axis tick marks:\n\to.yNumTicks = 5;\n\n\t// Boolean indicating whether to render a rug plot along the y-axis:\n\to.yRug = false;\n\n\t// y-axis rug orientation:\n\to.yRugOrient = 'left';\n\n\t// y-axis rug opacity:\n\to.yRugOpacity = 0.1; // [0,1]\n\n\t// y-axis rug tick (tassel) size:\n\to.yRugSize = 6; // px\n\n\t// y-axis scale:\n\to.yScale = 'linear';\n\n\t// y-axis tick format:\n\to.yTickFormat = null;\n\n\treturn o;\n}\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the plot `x` values.\n*\n* @private\n* @returns {Array} x values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xData.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the plot `y` values.\n*\n* @private\n* @returns {Array} y values\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yData.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from './../../is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an empty array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an empty array\n*\n* @example\n* var bool = isEmptyArray( [] );\n* // returns true\n*\n* @example\n* var bool = isEmptyArray( [ 1, 2, 3 ] );\n* // returns false\n*\n* @example\n* var bool = isEmptyArray( {} );\n* // returns false\n*/\nfunction isEmptyArray( value ) {\n\treturn (\n\t\tisArray( value ) &&\n\t\tvalue.length === 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isEmptyArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data labels.\n*\n* @private\n* @returns {(EmptyArray|StringArray)} labels\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._labels.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the accessor for defined values.\n*\n* @private\n* @returns {Function} accessor\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._isDefined;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data colors.\n*\n* @private\n* @returns {StringArray} colors\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._colors.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data line style(s).\n*\n* @private\n* @returns {StringArray} line style(s)\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._lineStyle.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data line opacity.\n*\n* @private\n* @returns {NumberArray} line opacity\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._lineOpacity.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data line width.\n*\n* @private\n* @returns {Array} line width(s)\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._lineWidth.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the data symbols.\n*\n* @private\n* @returns {StringArray} symbols\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._symbols.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the symbols size.\n*\n* @private\n* @returns {Array} symbols sizes\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._symbolsSize.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the symbols opacity.\n*\n* @private\n* @returns {NumberArray} symbols opacity\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._symbolsOpacity.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the width.\n*\n* @private\n* @returns {number} width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the height.\n*\n* @private\n* @returns {number} height\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._height;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the left padding.\n*\n* @private\n* @returns {number} padding\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._paddingLeft;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the right padding.\n*\n* @private\n* @returns {number} padding\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._paddingRight;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the top padding.\n*\n* @private\n* @returns {number} padding\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._paddingTop;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the bottom padding.\n*\n* @private\n* @returns {number} padding\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._paddingBottom;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport min from './../../utils/min.js'; // TODO: replace with mod when written\n\n\n// FUNCTIONS //\n\n/**\n* Computes a minimum value.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {(number|null)} minimum value or null\n*/\nfunction getMin( arr ) {\n\tvar tmp;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\ttmp = new Array( arr.length );\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\ttmp[ i ] = min( arr[ i ] );\n\t}\n\treturn min( tmp );\n}\n\n\n// MAIN //\n\n/**\n* Returns the minimum value of the x-axis domain.\n*\n* @private\n* @returns {number} minimum value\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar min;\n\tif ( isNull( this._xMin ) ) {\n\t\tmin = getMin( this._xData );\n\t\treturn ( isNull( min ) ) ? 0.0 : min;\n\t}\n\treturn this._xMin;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport max from './../../utils/max.js'; // TODO: replace with stdlib package import when added\n\n\n// FUNCTIONS //\n\n/**\n* Computes a maximum value.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {(number|null)} maximum value or null\n*/\nfunction getMax( arr ) {\n\tvar tmp;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\ttmp = [];\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\ttmp.push( max( arr[ i ] ) );\n\t}\n\treturn max( tmp );\n}\n\n\n// MAIN //\n\n/**\n* Returns the maximum value of the x-axis domain.\n*\n* @private\n* @returns {number} maximum value\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar max;\n\tif ( isNull( this._xMax ) ) {\n\t\tmax = getMax( this._xData );\n\t\treturn ( isNull( max ) ) ? 1.0 : max;\n\t}\n\treturn this._xMax;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport min from './../../utils/min.js'; // TODO: replace with mod when written\n\n\n// FUNCTIONS //\n\n/**\n* Computes a minimum value.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {(number|null)} minimum value or null\n*/\nfunction getMin( arr ) {\n\tvar tmp;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\ttmp = new Array( arr.length );\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\ttmp[ i ] = min( arr[ i ] );\n\t}\n\treturn min( tmp );\n}\n\n\n// MAIN //\n\n/**\n* Returns the minimum value of the y-axis domain.\n*\n* @private\n* @returns {number} minimum value\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar min;\n\tif ( isNull( this._yMin ) ) {\n\t\tmin = getMin( this._yData );\n\t\treturn ( isNull( min ) ) ? 0.0 : min;\n\t}\n\treturn this._yMin;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNull from '@stdlib/assert/is-null';\nimport max from './../../utils/max.js'; // TODO: replace with mod when written\n\n\n// FUNCTIONS //\n\n/**\n* Computes a maximum value.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {(number|null)} maximum value or null\n*/\nfunction getMax( arr ) {\n\tvar tmp;\n\tvar i;\n\tif ( arr.length === 0 ) {\n\t\treturn null;\n\t}\n\ttmp = new Array( arr.length );\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\ttmp[ i ] = max( arr[ i ] );\n\t}\n\treturn max( tmp );\n}\n\n\n// MAIN //\n\n/**\n* Returns the maximum value of the y-axis domain.\n*\n* @private\n* @returns {number} maximum value\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\tvar max;\n\tif ( isNull( this._yMax ) ) {\n\t\tmax = getMax( this._yData );\n\t\treturn ( isNull( max ) ) ? 1.0 : max;\n\t}\n\treturn this._yMax;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the number of x-axis tick marks.\n*\n* @private\n* @returns {(NonNegativeInteger|null)} number of ticks\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xNumTicks;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the number of y-axis tick marks.\n*\n* @private\n* @returns {(NonNegativeInteger|null)} number of ticks\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yNumTicks;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis orientation.\n*\n* @private\n* @returns {string} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xAxisOrient;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis orientation.\n*\n* @private\n* @returns {string} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yAxisOrient;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns whether a rug plot is displayed along the x-axis.\n*\n* @private\n* @returns {BooleanArray} boolean flags\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xRug.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns whether a rug plot is displayed along the y-axis.\n*\n* @private\n* @returns {BooleanArray} boolean flag\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yRug.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis rug orientation.\n*\n* @private\n* @returns {StringArray} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xRugOrient.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis rug orientation.\n*\n* @private\n* @returns {StringArray} orientation\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yRugOrient.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis rug opacity.\n*\n* @private\n* @returns {NumberArray} rug opacities\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xRugOpacity.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis rug opacity.\n*\n* @private\n* @returns {NumberArray} rug opacities\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yRugOpacity.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis rug tick (tassel) size.\n*\n* @private\n* @returns {Array} tick sizes\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xRugSize.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis rug tick (tassel) size.\n*\n* @private\n* @returns {Array} tick sizes\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yRugSize.slice();\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the description.\n*\n* @private\n* @returns {string} description\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._description;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the title.\n*\n* @private\n* @returns {string} title\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._title;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis label.\n*\n* @private\n* @returns {string} label\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._xLabel;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis label.\n*\n* @private\n* @returns {string} label\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._yLabel;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from './../../is-collection';\nimport { isPrimitive as isInteger } from './../../is-integer';\nimport { isPrimitive as isString } from './../../is-string';\nimport indexOfSameValue from '@stdlib/array/base/index-of-same-value';\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like value contains a search value.\n*\n* @param {(Collection|string)} value - input value\n* @param {*} searchValue - search value\n* @param {integer} [position=0] - position at which to start searching for `searchValue`\n* @throws {TypeError} first argument must be array-like\n* @throws {Error} must provide a search value\n* @throws {TypeError} second argument must be a string when the first argument is a string\n* @throws {TypeError} third argument must be an integer\n* @returns {boolean} boolean indicating whether one value contains another\n*\n* @example\n* var bool = contains( 'last man standing', 'stand' );\n* // returns true\n*\n* @example\n* var bool = contains( [ 1, 2, 3, 4 ], 2 );\n* // returns true\n*\n* @example\n* var bool = contains( 'presidential election', 'president' );\n* // returns true\n*\n* @example\n* var bool = contains( [ NaN, 2, 3, 4 ], NaN );\n* // returns true\n*\n* @example\n* var bool = contains( 'javaScript', 'js' );\n* // returns false\n*\n* @example\n* var bool = contains( [ 1, 2, 3, {} ], {} );\n* // returns false\n*\n* @example\n* var bool = contains( 'Hidden Treasures', '' );\n* // returns true\n*/\nfunction contains( value, searchValue, position ) {\n\tvar isStr;\n\tvar pos;\n\n\tisStr = isString( value );\n\tif ( !isCollection( value ) && !isStr ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', value ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide a search value.' );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isInteger( position ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', position ) );\n\t\t}\n\t\tpos = position;\n\t\tif ( pos < 0 ) {\n\t\t\tpos = 0;\n\t\t}\n\t} else {\n\t\tpos = 0;\n\t}\n\tif ( isStr ) {\n\t\tif ( !isString( searchValue ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', searchValue ) );\n\t\t}\n\t\treturn value.indexOf( searchValue, pos ) !== -1;\n\t}\n\treturn indexOfSameValue( value, searchValue, pos ) !== -1;\n}\n\n\n// EXPORTS //\n\nexport default contains;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the plot engine.\n*\n* @private\n* @returns {string} engine\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._engine;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the rendering mode.\n*\n* @private\n* @returns {boolean} rendering mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoRender;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the render format.\n*\n* @private\n* @returns {string} format\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._renderFormat;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the plot viewer.\n*\n* @private\n* @returns {string} viewer\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._viewer;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the viewing mode.\n*\n* @private\n* @returns {boolean} viewing mode\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._autoView;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the expected graph width.\n*\n* @private\n* @returns {number} graph width\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._width - this._paddingLeft - this._paddingRight;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the expected graph height.\n*\n* @private\n* @returns {number} graph height\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn this._height - this._paddingTop - this._paddingBottom;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis domain.\n*\n* @private\n* @returns {Array} domain\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn [ this.xMin, this.xMax ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis domain.\n*\n* @private\n* @returns {Array} domain\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn [ this.yMin, this.yMax ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the x-axis range.\n*\n* @private\n* @returns {NumberArray} range\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn [ 0, this.graphWidth ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the y-axis range.\n*\n* @private\n* @returns {NumberArray} range\n*/\nfunction get() {\n\t/* eslint-disable no-invalid-this */\n\treturn [ this.graphHeight, 0 ];\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string/format';\n\n\n// MAIN //\n\n/**\n* Validates that an instance is in a valid state for rendering.\n*\n* @private\n* @param {Object} state - state\n* @throws {Error} must be in a valid state to render\n*/\nfunction validate( state ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar x;\n\tvar y;\n\tvar i;\n\n\tx = state._xData;\n\ty = state._yData;\n\tif ( x.length !== y.length ) {\n\t\tthrow new Error( format( 'invalid state. x and y are different lengths. x length: `%u`. y length: `%u`.', x.length, y.length ) );\n\t}\n\t// TODO: will need to refactor to some degree to support `ndarray`-like `x` and `y`\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( x[ i ].length !== y[ i ].length ) {\n\t\t\tthrow new Error( format( 'invalid state. Each `x[i]:y[i]` pair must be the same length. x[%u].length: `%u`, y[%u].length: `%u`.', i, x[i].length, i, y[i].length ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a 2-dimensional plot.\n*\n* @module @stdlib/plot/ctor\n*\n* @example\n* import Plot from '@stdlib/plot/ctor';\n*\n* var x = [ 1, 2, 3 ];\n* var y = [ 1, 0, 1 ];\n*\n* var p = new Plot( [ x ], [ y ] );\n*\n* @example\n* import Plot from '@stdlib/plot/ctor';\n*\n* var opts = {\n* 'width': 600,\n* 'height': 400\n* };\n* var myPlot = Plot.factory( opts );\n*\n* var h1 = myPlot( [[1,2,3]], [[1,0,1]] );\n* var h2 = myPlot( [[4,5,6]], [[0,1,0]] );\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport factory from './factory.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert/is-plain-object';\nimport format from '@stdlib/string/format';\nimport copy from '@stdlib/utils/copy';\nimport Plot from './main.js';\n\n\n// MAIN //\n\n/**\n* Returns a reusable function for generating plots.\n*\n* @param {Options} [options] - factory options\n* TODO\n* @throws {TypeError} must provide an object\n* @returns {Function} plot function\n*\n* @example\n* var opts = {\n* 'width': 600,\n* 'height': 400\n* };\n* var plot = factory( opts );\n* var h1 = plot( [[1,2,3]], [[1,0,1]] );\n* var h2 = plot( [[4,5,6]], [[0,1,0]] );\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = copy( options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn plot;\n\n\t/**\n\t* Creates a plot.\n\t*\n\t* @private\n\t* @param {Array} [x] - x-values\n\t* @param {Array} [y] - y-values\n\t* @throws {TypeError} must provide valid options\n\t* @returns {Plot} plot instance\n\t*/\n\tfunction plot( x, y ) {\n\t\tif ( arguments.length === 2 ) {\n\t\t\treturn new Plot( x, y, opts );\n\t\t}\n\t\treturn new Plot( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n"],"names":["main","Object","defineProperty","isNumber","value","zeros","n","i","out","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","f","digits","toExponential","toFixed","toPrecision","spaces","spacePad","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","parseFloat","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","toStr","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","err","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","defineProperty$1","setNonEnumerableReadOnly","configurable","enumerable","writable","keys","bool","FLG","Symbol","hasToStringTagSupport","toStringTag","has","hasOwnProperty","hasOwnProp","property","Sym","toStrTag","hasToStringTag","v","isOwn","tag","nativeClass","isArguments","hasArgumentsClass","detect","isString","valueOf","test","isPrimitive","isObject","setReadOnly","main$f","Number","x","isNan","FLOAT64_PINF","POSITIVE_INFINITY","FLOAT64_NINF","NEGATIVE_INFINITY","floor","isInteger","PINF","NINF","isInt","isEnumerableProperty","propertyIsEnumerable","hasStringEnumBug","isEnum","main$e","UINT32_MAX","MAX_LENGTH","isArguments$1","arrayfcn","predicate","len","isObjectLike","noop","arrayfun","MAX_TYPED_ARRAY_LENGTH","isCollection","arr","searchElement","fromIndex","isBoolean","Bool","Boolean","self","window","global","globalThis","getGlobal","codegen","Function","GlobalThis","Self","Win","Global","root","nodeList","document","childNodes","typedarray","Int8Array","reFunctionName","RE_FUNCTION_NAME","isBuffer","_isBuffer","constructor","constructorName","name","ctor","REGEXP","ctorName","type","isConstructorPrototype","w","k","typeOf","win","EXCLUDED_KEYS","check","hasAutomationEqualityBug","HAS_BUILTIN","skipConstructor","skipPrototype","isFcn","p","HAS_ENUM_PROTO_BUG","HAS_NON_ENUM_PROPS_BUG","HAS_WINDOW","error","NON_ENUMERABLE","main$c","isFunction","getProto","Obj","getPrototypeOf","proto","getProto$1","objectPrototype","isPlainObject","isPrototypeOf","key","ownProps","isNonNegativeInteger","isError","reRegExp","getOwnPropertyNames","propertyNames","getOwnPropertyDescriptor","propertyDescriptor","desc","Buffer","b","GlobalBuffer","from","hasNodeBufferSupport","copyBuffer$1","buffer","hasInt8Array","GlobalInt8Array","INT8_MAX","hasInt8ArraySupport","Int8Array$1","hasUint8Array","Uint8Array","GlobalUint8Array","UINT8_MAX","hasUint8ArraySupport","Uint8Array$1","hasUint8ClampedArray","Uint8ClampedArray","GlobalUint8ClampedArray","hasUint8ClampedArraySupport","Uint8ClampedArray$1","hasInt16Array","Int16Array","GlobalInt16Array","INT16_MAX","hasInt16ArraySupport","Int16Array$1","hasUint16Array","Uint16Array","GlobalUint16Array","UINT16_MAX","hasUint16ArraySupport","Uint16Array$1","hasInt32Array","Int32Array","isInt32Array","INT32_MAX","GlobalInt32Array","hasInt32ArraySupport","Int32Array$1","hasUint32Array","Uint32Array","GlobalUint32Array","hasUint32ArraySupport","Uint32Array$1","hasFloat32Array","Float32Array","GlobalFloat32Array","hasFloat32ArraySupport","Float32Array$1","hasFloat64Array","Float64Array","hasFloat64ArraySupport","GlobalFloat64Array","NaN","Float64Array$1","int8array","uint8array","uint8clampedarray","int16array","uint16array","int32array","uint32array","float32array","float64array","typedArrays","deepCopy","val","copy","cache","refs","level","parent","ref","copyBuffer","tmp","message","stack","code","errno","syscall","objectKeys","copyError","Date","RegExp","regexp","Set","Map","freeze","names","create","isExtensible","preventExtensions","isSealed","seal","isFrozen","cloneInstance","validate","createObject","Ctor","createObject$1","inherit","superCtor","defaults","override","extend","deepMerge","target","source","hasProp","isFunc","curr","mergefcn","opts","nargs","src","merge","isPositiveInteger","factory","options","setNonEnumerableReadOnlyAccessor","getter","setNonEnumerableReadWriteAccessor","setter","TYPE","isAccessorArray","GETTERS","float64","idx","float32","int32","int16","int8","uint32","uint16","uint8","uint8c","generic","default","dtype","SETTERS","complex128","complex64","ctor2dtypes","Complex64Array","Complex128Array","BooleanArray","MAX_ARRAY_LENGTH","isArrayLikeObject","hasArrayBuffer","ArrayBuffer","isArrayBuffer","isPrimitiveArray","isObjectArray","isStringArray","Complex128","real","imag","this","re","im","float64ToFloat32","fround","FLOAT32_VIEW","float64ToFloat32$1","Complex64","isComplexLike","isEven","BYTES_PER_ELEMENT","isComplex64Array","isComplex128Array","hasIteratorSymbolSupport","iterator","IteratorSymbol","z","reinterpret","offset","byteOffset","fromIterator","it","next","done","realf","imagf","HAS_ITERATOR_SYMBOL","isComplexArray","_length","_buffer","isComplexArrayConstructor","getComplex64","buf","fromArray","RangeError","reinterpret64","reinterpret128","byteLength","ITERATOR_SYMBOL","thisArg","clbk","flg","accessorGetter","fromIteratorMap","setReadOnlyAccessor","start","copyWithin","iter","entries","end","fcn","separator","sep","join","outbuf","reducer","initialValue","acc","N","sbuf","outlen","compareFcn","sort","begin","locales","loc","toLocaleString","values","index","getComplex128","isBooleanArray","isBooleanArrayConstructor","a","CTORS","DTYPES","NTYPES","ctor2dtype","arraylike2object","dt","data","accessorProtocol","accessors","accessorSetter","gcopy","strideX","offsetX","y","strideY","offsetY","xbuf","ybuf","ix","iy","M","ox","oy","m","foo","isFunctionNameSupported","TypedArray","Dummy","fcnName","instanceOf","typeName","typedarray2json","NAMES","isTypedArray","isComplexTypedArray","reinterpretBoolean","MAX","randint32","random","NORMALIZATION_CONSTANT","STATE_ARRAY_VERSION","NUM_STATE_SECTIONS","STATE_SECTION_OFFSET","SEED_SECTION_OFFSET","STATE_FIXED_LENGTH","verifyState","state","s1","STATE","seed","slen","ndarray","minstd","getSeed","getSeedLength","setReadWriteAccessor","getState","setState","getStateLength","getStateSize","toJSON","normalized","NAME","MIN","s","params","matchHtmlRegExp","escapeHtml_1","string","escape","html","charCodeAt","immutable","version","require$$0","isVnode","isVtext","isThunk_1","t","isWidget_1","softSetHook","SoftSetHook","hook","node","propertyName","attributeHook","AttributeHook","namespace","setAttributeNS","unhook","colonPosition","localName","removeAttributeNS","callback","LANGUAGES","tr","map","I","az","lt","J","lowerCase","locale","lang","NON_WORD_REGEXP","CAMEL_CASE_REGEXP","TRAILING_DIGIT_REGEXP","sentenceCase","replacement","types","BOOLEAN","OVERLOADED_BOOLEAN","propertyConfig","attributeTypes","properties","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autocomplete","autofocus","autoplay","cellPadding","cellSpacing","charset","checked","classID","className","cols","colSpan","contentEditable","contextMenu","controls","coords","crossOrigin","dateTime","defer","dir","disabled","download","draggable","enctype","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","height","hidden","href","hreflang","htmlFor","httpEquiv","icon","id","label","list","loop","manifest","marginHeight","marginWidth","max","maxLength","media","mediaGroup","method","min","multiple","muted","noValidate","open","pattern","placeholder","poster","preload","radiogroup","readOnly","rel","required","role","rows","rowSpan","sandbox","scope","scrolling","seamless","selected","shape","size","sizes","span","spellcheck","srcdoc","srcset","step","style","tabIndex","title","useMap","wmode","autocapitalize","autocorrect","itemProp","itemScope","itemType","attributeNames","require$$1","prefixAttribute","createAttribute_1","isAttribute","attrType","shouldSkip","isVNode","require$$2","isVText","require$$3","isThunk","require$$4","isWidget","require$$5","softHook","require$$6","attrHook","require$$7","paramCase","createAttribute","require$$9","voidElements","area","br","col","embed","hr","img","input","keygen","link","meta","param","track","wbr","vdomToHtml","toHTML","render","props","ret","tagName","css","styleProp","trim","attr","dataProp","attrProp","openTag","innerHTML","children","l","tagContent","closeTag","text","__dirname$2","readfile","readFile","readfileSync","readFileSync","file","sync","__dirname$1","port","maxport","hostname","address","http","debug","PLATFORM","platform","IS_WINDOWS","IS_DARWIN","RE_URI","RE_ILLEGALS","RE_HEX1","RE_HEX2","RE_PATH","RE_SCHEME","ARGS","CMD","spawn","openURL","url","proc","authority","scheme","parts","path","isURI","unref","string2buffer$1","encoding","nextTick","httpServer","connections","isClosing","server","sopts","fpath","boot","javascript","onConnection","socket","remoteAddress","remotePort","on","sendHTML","request","response","statusCode","setHeader","sendJavaScript","onFinish","close","setTimeout","destroyConnections","destroy","onClose","string2buffer","serverOpts","resolve","__dirname","requestListener","DEFAULTS","createServer","listen","once","addr","unavailable","onTick","notFound","_server","ENV","env","electron","require","JSON","stringify","tryRequire","view","plot","viewer","vtree","console","log","stdout","browser","SERVER_PORT","SERVER_ADDRESS","PLOT_WIDTH","PLOT_HEIGHT","PLOT_APP_PATH","PLOT_MIN_WIDTH","PLOT_MIN_HEIGHT","PLOT_TITLE","cwd","detached","stdio","globalScope$1","globalScope","versions","release","RE_MODULE_ID","RE_ERROR_STACK","isNodeREPL","IS_NODE","module","isDefined","d","COLORS","isArrayLike","arraylikefcn","isNumberArray","isNonNegativeIntegerArray","isPositiveNumber","isNull","getMin","getMax","ascending$1","bisector","compare","ascending","ascendingComparator","left","lo","hi","mid","bisectRight","number$2","e10","sqrt","e5","e2","ticks$2","stop","count","reverse","ticks","tickIncrement","ceil","power","LN10","pow","tickStep","step0","step1","threshold$1","valueof","number","i0","value0","prefix","object","each","o","remove","clear","empty","add","array","implicit","ordinal","range","domain","unknown","scale","_","band","bandwidth","undefined","ordinalRange","round","paddingInner","paddingOuter","align","rescale","sequence","rangeRound","padding","pointish","define","definition","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","color","rgbn","Rgb","rgba","hsla","r","g","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","isNaN","h","Hsl","hslConvert","hsl2rgb","m1","m2","channels","assign","displayable","formatHsl","deg2rad","PI","rad2deg","A","B","C","D","E","ED","EB","BC_DA","cubehelix","Cubehelix","bl","atan2","cubehelixConvert","constant$2","linear","gamma","nogamma","exponential","constant","cosh","cos","sinh","sin","rgbGamma","colorRgb","numberArray","c","genericArray","nb","na","date$1","setTime","reinterpolate$1","reA","reB","am","bm","bs","bi","q","one","zero","interpolateValue","date","isView","DataView","interpolateRound","hue","cubehelixGamma","colorCubehelix","cubehelixLong","constant$1","number$1","unit","deinterpolateLinear","bimap","deinterpolate","reinterpolate","d0","d1","r0","r1","polymap","bisect","clamp","continuous","piecewise","output","deinterpolateClamp","invert","reinterpolateClamp","formatDecimalParts","coefficient","exponent","prefixExponent","formatSpecifier","FormatSpecifier","fill","symbol","comma","formatRounded","formatTypes","e","X","identity$3","formatPrefix","prefixes","formatLocale$1","grouping","thousands","group","identity","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","i1","formatTrim","Infinity","defaultLocale","formatLocale","precisionFixed","precisionPrefix","precisionRound","linearish","tickFormat","nice","interval","x0","x1","pow10","powp","exp","logp","log10","log2","reflect","raise","t0","t1","newInterval","floori","offseti","field","previous","filter","every","millisecond","utcMillisecond","durationSecond","durationMinute","durationHour","durationDay","durationWeek","second","getMilliseconds","getUTCSeconds","utcSecond","minute","getSeconds","getMinutes","timeMinute","hour","getHours","timeHour","day","setHours","setDate","getDate","getTimezoneOffset","timeDay","weekday","getDay","sunday","monday","tuesday","wednesday","thursday","friday","saturday","month","setMonth","getMonth","getFullYear","timeMonth","year","setFullYear","timeYear","utcMinute","setUTCSeconds","getUTCMinutes","utcMinute$1","utcHour","setUTCMinutes","getUTCHours","utcHour$1","utcDay","setUTCHours","setUTCDate","getUTCDate","utcDay$1","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcMonth","setUTCMonth","getUTCMonth","getUTCFullYear","utcMonth$1","utcYear","setUTCFullYear","utcYear$1","localDate","H","S","L","utcDate","UTC","newDate","locale_dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatDayOfMonth","formatMicroseconds","formatYearISO","G","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","Q","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","u","formatWeekdayNumberMonday","U","formatWeekNumberSunday","V","formatWeekNumberISO","formatWeekdayNumberSunday","W","formatWeekNumberMonday","formatYear","Y","formatFullYear","Z","formatZone","formatLiteralPercent","utcFormats","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","newParse","week","timeMonday","utcFormat","utcParse","timeFormat","timeParse","numberRe","percentRe","requoteRe","requote","timeSunday","dISO","timeThursday","getUTCMilliseconds","dow","UTCdISO","isoSpecifier","formatIso","toISOString","formatIso$1","parseIso","parseIso$1","durationMonth","durationYear","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","tickIntervals","tickInterval","colors","category10","category20b","category20c","category20","interpolateCubehelixLong","warm","cool","rainbow","ramp","viridis","magma","inferno","plasma","ts","logs","pows","quantile","thresholds","threshold","invertExtent","quantiles","quantize","sequential","interpolator","timeWeek","timeSecond","timeMillisecond","utcWeek","scaleLinear","scaleTime","C64_BYTES_PER_ELEMENT","C128_BYTES_PER_ELEMENT","isSameValue","reim","z2","parts1","parts2","isSame","resolveGetter","complex","indexOfSameValue","boolean","indexed","xRugTransform","orient","yRugTransform","marks","$","svg","concat","nOpacities","lineStyle","nColors","nStyles","nWidths","line","lineOpacity","lineWidth","labels","lines","nSymbols","nSizes","sym","symbols","symbolsOpacity","symbolsSize","rugTransform","nOrients","nFlgs","rug","xRug","xRugOpacity","xRugOrient","xRugSize","orientation","graphHeight","attributes","transform","yRug","yRugOpacity","yRugOrient","yRugSize","graphWidth","nativeIsArray","xIsArray","isVhook","isVHook","vnode","VirtualNode","noProperties","noChildren","hooks","descendants","hasWidgets","hasThunks","descendantHooks","propName","child","vtext","VirtualText","split","undef","nativeSplit","compliantExecNpcg","limit","separator2","lastLength","ignoreCase","multiline","extended","sticky","lastLastIndex","classIdSplit","notClassId","parseTag_1","classes","part","noId","tagParts","exports","Individual","oneVersion","moduleName","defaultValue","versionValue","hashKey","evStore","elem","hash","EvStore","evHook","EvHook","VNode","VText","isHook","isVThunk","parseTag","require$$8","require$$10","virtualHyperscript","isChild","isChildren","transformProperties","addChild","errorString","foreignObject","parentVnode","UnexpectedVirtualElement","h_1","EventEmitter","Annotations","emit","validators","autoRender","KEYS","EVENTS","CHANGE_EVENT","events","ELEMENT","ctx","ClipPath","_autoRender","isValid","_width","_height","_id","rect","Canvas","translateX","translateY","Graph","_translateX","_translateY","Title","_text","clipPathId","Marks","_clipPathId","Background","stroke","Defs","ORIENTATIONS","numTicks","tickPadding","tickSize","innerTickSize","outerTickSize","tickTransform","xAttr","yAttr","dy","_orientation","tickDir","_innerTickSize","txt","tickSpacing","labelTransform","labelXPos","labelYPos","_scale","tick","unshift","range0","range1","_outerTickSize","_label","logger","Axis","_ticks","_numTicks","_tickFormat","fmt","_tickSize","_tickPadding","center","components","pi","tau","epsilon","tauEpsilon","Path","_x0","_y0","_x1","_y1","moveTo","closePath","lineTo","quadraticCurveTo","y1","bezierCurveTo","x2","y2","arcTo","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","acos","t01","t21","arc","a0","a1","ccw","dx","cw","da","halfPi","asin","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","x11","y11","x10","y10","x00","y00","d2","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","Linear","context","_context","curveLinear","line$1","pointX","pointY","defined","curve","defined0","lineStart","lineEnd","point","x0z","y0z","areaStart","areaEnd","arealine","lineX0","lineY0","lineY1","lineX1","descending$1","_line","_point","curveRadialLinear","curveRadial","Radial","_curve","radial","lineRadial","angle","radius","lineRadial$1","areaRadial","lineStartAngle","lineEndAngle","lineInnerRadius","lineOuterRadius","pointRadial","linkSource","linkTarget","argv","curveHorizontal","curveVertical","p0","p1","p2","p3","circle","draw","cross","tan30","tan30_2","diamond","kr","kx","ky","star","square","sqrt3","triangle","wye","that","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","_x2","_x3","_x4","_y2","_y3","_y4","_x","_y","bundle","custom","_k","Cardinal","tension","cardinal","CardinalClosed","_x5","_y5","cardinalClosed","CardinalOpen","cardinalOpen","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","alpha","_alpha","x23","y23","catmullRom","CatmullRomClosed","catmullRomClosed","CatmullRomOpen","catmullRomOpen","LinearClosed","slope3","h0","h1","s0","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","none$1","series","order","none","stackValue","appearance","peaks","peak","vi","vj","sums","sum","_t0","px","py","cornerRadius","padRadius","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","oc","x3","y3","x32","y32","intersect","ax","ay","bx","by","kc","lc","centroid","sortValues","descending","pie","arcs","pa","orderNone","offsetNone","oz","kz","sz","sij","ki","si","yp","yn","s2","sij0","s3","sk","top","bottom","tops","bottoms","zip","STYLES","PRIVATE_PROPS","xScale","yScale","_xData","_yData","_xScale","_yScale","_isDefined","_color","_opacity","_style","xPos","yPos","RENDER","xi","yi","Symbols","SYMBOLS","_symbol","_size","isNum","Rug","_data","annotations","clipPath","canvas","graph","xAxis","yAxis","bkgd","defs","Bkgd","init","paddingLeft","paddingTop","xLabel","xTickFormat","xNumTicks","xAxisOrient","yLabel","yTickFormat","yNumTicks","yAxisOrient","renderMarks","xAxisTransform","yAxisTransform","vdom2html","mergeFcn","Plot","isREPL","autoView","description","engine","paddingBottom","paddingRight","renderFormat","xMax","xMin","yMax","yMin","_autoView","_viewer","isEmptyArray","_labels","isStr","_colors","LINESTYLES","_lineStyle","_lineOpacity","_lineWidth","_symbols","_symbolsSize","_symbolsOpacity","_paddingLeft","_paddingRight","_paddingTop","_paddingBottom","_xMin","_xMax","_yMin","_yMax","xDomain","xRange","yDomain","yRange","_xTickFormat","_yTickFormat","_xNumTicks","_yNumTicks","_xAxisOrient","_yAxisOrient","isBool","_xRug","_yRug","_xRugOrient","_yRugOrient","_xRugOpacity","_yRugOpacity","_xRugSize","_yRugSize","_description","_title","_xLabel","_yLabel","searchValue","position","contains","ENGINES","_engine","FORMATS","_renderFormat","VIEWERS","renderSVG","_view"],"mappings":";;AAsBA,IAAIA,EAA0C,mBAA1BC,OAAOC,eAAkCD,OAAOC,eAAiB,KCiCrF,IAAIA,EAAiBD,OAAOC,eCjB5B,SAASC,EAAUC,GAClB,MAA0B,iBAAVA,CACjB,CCAA,SAASC,EAAOC,GACf,IACIC,EADAC,EAAM,GAEV,IAAMD,EAAI,EAAGA,EAAID,EAAGC,IACnBC,GAAO,IAER,OAAOA,CACR,CAcA,SAASC,EAASC,EAAKC,EAAOC,GAC7B,IAAIC,GAAW,EACXC,EAAMH,EAAQD,EAAIK,OACtB,OAAKD,EAAM,IAnCZ,SAA0BJ,GACzB,MAAoB,MAAbA,EAAK,EACb,CAoCMM,CAAiBN,KACrBG,GAAW,EACXH,EAAMA,EAAIO,OAAQ,IAEnBP,EAAM,EACLA,EAAML,EAAOS,GACbT,EAAOS,GAAQJ,EACXG,IACJH,EAAM,IAAMA,IAVLA,CAaT,CCpDA,IAAIQ,EAAYC,OAAOC,UAAUC,YAC7BC,EAAYH,OAAOC,UAAUG,YAajC,SAASC,EAAeC,GACvB,IAAIC,EACAlB,EACAD,EAEJ,OAASkB,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I,GAExB,OAAO,IAAIumD,GAAMvmD,EACjB,CACF","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,312,313,314,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,334,336,339,340,341,342,343,344,345,354,355,356,358,363,364,365,366,373,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,478,491,492,493,494,495,496,497,498,499,500,515,516,517,518,519,520,521,522,523,524,525,526,634,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,822,858]} \ No newline at end of file diff --git a/package.json b/package.json index e8a1a26..0579190 100644 --- a/package.json +++ b/package.json @@ -3,29 +3,8 @@ "version": "0.3.3", "description": "Plotting.", "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": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./mod.js", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -34,49 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/assert": "github:stdlib-js/assert#main", - "@stdlib/fs": "github:stdlib-js/fs#main", - "@stdlib/net": "github:stdlib-js/net#main", - "@stdlib/process": "github:stdlib-js/process#main", - "@stdlib/random": "github:stdlib-js/random#main", - "@stdlib/string": "github:stdlib-js/string#main", - "@stdlib/utils": "github:stdlib-js/utils#main", - "d3-format": "^1.0.0", - "d3-scale": "^1.0.0", - "d3-shape": "^1.0.0", - "d3-time-format": "^2.0.0", - "debug": "^2.6.9", - "vdom-to-html": "^2.3.0" - }, - "devDependencies": { - "@stdlib/array": "github:stdlib-js/array#main", - "@stdlib/bench": "github:stdlib-js/bench#main", - "@stdlib/constants": "github:stdlib-js/constants#main", - "@stdlib/math": "github:stdlib-js/math#main", - "@stdlib/ndarray": "github:stdlib-js/ndarray#main", - "@stdlib/streams": "github:stdlib-js/streams#main", - "@stdlib/time": "github:stdlib-js/time#main", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "proxyquire": "^2.0.0", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "figure", diff --git a/sparklines/README.md b/sparklines/README.md deleted file mode 100644 index 9aa8cdf..0000000 --- a/sparklines/README.md +++ /dev/null @@ -1,98 +0,0 @@ - - -# Sparklines - -> Sparklines. - -
- -## Usage - -```javascript -var ns = require( '@stdlib/plot/sparklines' ); -``` - -#### ns - -Namespace for sparkline functionality. - -```javascript -var o = ns; -// returns {...} -``` - - - -
- -- [`base`][@stdlib/plot/sparklines/base]: base sparkline functionality. -- [`unicode( [data,] [options] )`][@stdlib/plot/sparklines/unicode]: create a Unicode sparkline. - -
- - - -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/plot/sparklines' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/sparklines/base/README.md b/sparklines/base/README.md deleted file mode 100644 index d431d3e..0000000 --- a/sparklines/base/README.md +++ /dev/null @@ -1,95 +0,0 @@ - - -# Base - -> Base sparkline functionality. - -
- -## Usage - -```javascript -var ns = require( '@stdlib/plot/sparklines/base' ); -``` - -#### ns - -Namespace containing "base" (i.e., lower-level) sparkline functionality. - -```javascript -var o = ns; -// returns {...} -``` - - - -
- -- [`Sparkline( [data,] [options] )`][@stdlib/plot/sparklines/base/ctor]: base class for sparklines. - -
- - - -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/plot/sparklines/base' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/sparklines/base/ctor/README.md b/sparklines/base/ctor/README.md deleted file mode 100644 index 5a5b64b..0000000 --- a/sparklines/base/ctor/README.md +++ /dev/null @@ -1,408 +0,0 @@ - - -# Sparkline - -> Base class for sparklines. - -
- -## Usage - -```javascript -var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); -``` - -#### Sparkline( \[data,] \[options] ) - -Returns a `sparkline` instance. - -```javascript -var sparkline = new Sparkline(); -// returns -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: sparkline data. -- **description**: sparkline description. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. - -* * * - -### Writable Properties - - - -#### Sparkline.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var sparkline = new Sparkline(); - -// Set: -sparkline.autoRender = false; - -// Get: -var mode = sparkline.autoRender; -// returns false -``` - - - -#### Sparkline.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var sparkline = new Sparkline(); - -// Set: -sparkline.bufferSize = 3; - -// Get: -var size = sparkline.bufferSize; -// returns 3 - -sparkline.data = [ 1, 2, 3 ]; - -var data = sparkline.data; -// returns [ 1, 2, 3 ] - -sparkline.push( 4 ); - -data = sparkline.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### Sparkline.prototype.data - -Sparkline data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var sparkline = new Sparkline(); - -// Set: -sparkline.data = new Float32Array( [ 3.14, 5.0, -3.14, -1.0 ] ); - -// Get: -var data = sparkline.data; -// returns [ ~3.14, 5.0, ~-3.14, -1.0 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### Sparkline.prototype.description - -Sparkline description. - -```javascript -var sparkline = new Sparkline(); - -// Set: -sparkline.description = 'Daily stock prices for the past 30 days.'; - -// Get: -var desc = sparkline.description; -// returns 'Daily stock prices for the past 30 days.' -``` - - - -#### Sparkline.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var sparkline = new Sparkline(); - -// Set: -sparkline.isDefined = isDefined; - -// Get: -var fcn = sparkline.isDefined; -// returns -``` - -The default behavior is to ignore values which are `NaN`. - - - -#### Sparkline.prototype.label - -Data label. - -```javascript -var sparkline = new Sparkline(); - -// Set: -sparkline.label = 'beep'; - -// Get: -var label = sparkline.label; -// returns 'beep' -``` - -* * * - -### Methods - - - -#### Sparkline.prototype.push( datum ) - -Appends data to a sparkline. - -```javascript -var sparkline = new Sparkline(); - -// Set: -sparkline.data = [ 1, 2, 3 ]; - -// Get: -var data = sparkline.data; -// returns [ 1, 2, 3 ] - -sparkline.push( 4 ); - -data = sparkline.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### Sparkline.prototype.\_render() - -Private method for rendering a sparkline. This method **should be** implemented by `Sparkline` descendants. - - - -```javascript -function render() { - return '▁█▅▃▆▆▅'; -} - -var sparkline = new Sparkline(); - -sparkline._render = render; -``` - - - -#### Sparkline.prototype.render() - -Public method for rendering a sparkline which internally invokes the private `_render()` method. - - - -```javascript -function render() { - return '▁█▅▃▆▆▅'; -} - -var sparkline = new Sparkline(); - -sparkline._render = render; - -var str = sparkline.render(); -// returns '▁█▅▃▆▆▅' -``` - - - -#### Sparkline.prototype.toString() - -Serializes a sparkline as a `string` by calling the public `render()` method. - - - - - -```javascript -function render() { - return '▁█▅▃▆▆▅'; -} - -var sparkline = new Sparkline(); - -sparkline._render = render; - -var str = sparkline.toString(); -// returns '▁█▅▃▆▆▅' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var sparkline = new Sparkline(); - -sparkline.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var sparkline = new Sparkline(); - -sparkline.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); - -// Define a chart constructor: -function Chart( opts ) { - if ( opts === void 0 ) { - opts = {}; - } - // Call the parent constructor: - Sparkline.call( this, opts ); - - return this; -} - -// Inherit from the Sparkline constructor: -inherit( Chart, Sparkline ); - -// Implement a custom render method: -Chart.prototype._render = function render() { - var str; - var i; - - str = ''; - for ( i = 0; i < this._data.length; i++ ) { - if ( this._data[ i ] > 0 ) { - str += '↑'; - } else { - str += '↓'; - } - } - return str; -}; - -// Create a new chart instance: -var chart = new Chart(); - -// Set chart data: -chart.data = [ 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0 ]; - -// Render the chart: -console.log( chart.render() ); -// => '↑↓↓↑↓↑↑↑↓↑↑↓↓' -``` - -
- - - - - - - - - - - - - - diff --git a/sparklines/base/ctor/benchmark/benchmark.js b/sparklines/base/ctor/benchmark/benchmark.js deleted file mode 100644 index 45261a2..0000000 --- a/sparklines/base/ctor/benchmark/benchmark.js +++ /dev/null @@ -1,301 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var Sparkline = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new Sparkline(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = Sparkline; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new Sparkline( opts ); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new Sparkline( [ 1, 2, 3 ] ); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new Sparkline( [ 1, 2, 3 ], opts ); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof Sparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new Sparkline(); - v._render = noop; // eslint-disable-line no-underscore-dangle - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/base/ctor/docs/repl.txt b/sparklines/base/ctor/docs/repl.txt deleted file mode 100644 index a9266c1..0000000 --- a/sparklines/base/ctor/docs/repl.txt +++ /dev/null @@ -1,85 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a Sparkline instance. - - This constructor is a base Sparkline constructor from which constructors - tailored to generating particular types of Sparkline graphics should be - derived. - - At a minimum, descendants should implement a private `_render()` method - which will be automatically invoked by the public `render()` method. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Sparkline data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Sparkline data. - - options.description: string (optional) - Sparkline description. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - Returns - ------- - sparkline: Sparkline - Sparkline instance. - - sparkline.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - sparkline.bufferSize - Data buffer size. - - sparkline.description - Sparkline description. - - sparkline.data - Sparkline data. - - sparkline.label - Data label. - - sparkline.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - sparkline.render() - Renders a sparkline. This method calls `_render()` which must be - implemented by instances and child classes. The default behavior is - throw an error. - - Examples - -------- - > var sparkline = new {{alias}}() - - - // Provide sparkline data at instantiation: - > var data = [ 1, 2, 3 ]; - > sparkline = new {{alias}}( data ) - - - See Also - -------- - diff --git a/sparklines/base/ctor/examples/index.js b/sparklines/base/ctor/examples/index.js deleted file mode 100644 index 15e2b61..0000000 --- a/sparklines/base/ctor/examples/index.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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-underscore-dangle */ - -'use strict'; - -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../lib' ); - -// Define a chart constructor: -function Chart( opts ) { - if ( opts === void 0 ) { - opts = {}; - } - // Call the parent constructor: - Sparkline.call( this, opts ); - - return this; -} - -// Inherit from the Sparkline constructor: -inherit( Chart, Sparkline ); - -// Implement a custom render method: -Chart.prototype._render = function render() { - var str; - var i; - - str = ''; - for ( i = 0; i < this._data.length; i++ ) { - if ( this._data[ i ] > 0 ) { - str += '↑'; - } else { - str += '↓'; - } - } - return str; -}; - -// Create a new chart instance: -var chart = new Chart(); - -// Set chart data: -chart.data = [ 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0 ]; - -// Render the chart: -console.log( chart.render() ); -// => '↑↓↓↑↓↑↑↑↓↑↑↓↓' diff --git a/sparklines/base/ctor/lib/accessors/is_defined.js b/sparklines/base/ctor/lib/accessors/is_defined.js deleted file mode 100644 index 2fb3f5a..0000000 --- a/sparklines/base/ctor/lib/accessors/is_defined.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive; - - -// VARIABLES // - -var debug = logger( 'sparkline:accessor:is-defined' ); - - -// MAIN // - -/** -* Accessor function which determines whether a datum is defined. -* -* @private -* @param {number} d - datum -* @param {integer} i - index -* @returns {boolean} boolean indicating whether a datum is defined -*/ -function isDefined( d ) { - var bool = !isnan( d ); - debug( 'Datum: %s. Defined: %s.', JSON.stringify( d ), bool ); - return bool; -} - - -// EXPORTS // - -module.exports = isDefined; diff --git a/sparklines/base/ctor/lib/defaults.js b/sparklines/base/ctor/lib/defaults.js deleted file mode 100644 index 5d80744..0000000 --- a/sparklines/base/ctor/lib/defaults.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var isDefined = require( './accessors/is_defined.js' ); - - -// MAIN // - -/** -* Returns default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var out = {}; - - // Boolean indicating whether to re-render on a `change` event: - out.autoRender = false; - - // Data buffer size: - out.bufferSize = FLOAT64_MAX; - - // Sparkline data: - out.data = []; - - // Sparkline description: - out.description = ''; - - // Accessor indicating whether a datum is defined: - out.isDefined = isDefined; - - // Data label: - out.label = ''; - - return out; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/sparklines/base/ctor/lib/index.js b/sparklines/base/ctor/lib/index.js deleted file mode 100644 index e8ec386..0000000 --- a/sparklines/base/ctor/lib/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Base class for sparklines. -* -* @module @stdlib/plot/sparklines/base/ctor -* -* @example -* var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); -* -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = Sparkline( data ); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/base/ctor/lib/main.js b/sparklines/base/ctor/lib/main.js deleted file mode 100644 index 0a44018..0000000 --- a/sparklines/base/ctor/lib/main.js +++ /dev/null @@ -1,433 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 EventEmitter = require( 'events' ).EventEmitter; -var logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var inherit = require( '@stdlib/utils/inherit' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var isCollection = require( '@stdlib/assert/is-collection' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var format = require( '@stdlib/string/format' ); -var defaults = require( './defaults.js' ); -var setAutoRender = require( './props/auto-render/set.js' ); -var getAutoRender = require( './props/auto-render/get.js' ); -var setBufferSize = require( './props/buffer-size/set.js' ); -var getBufferSize = require( './props/buffer-size/get.js' ); -var setData = require( './props/data/set.js' ); -var getData = require( './props/data/get.js' ); -var setDescription = require( './props/description/set.js' ); -var getDescription = require( './props/description/get.js' ); -var setIsDefined = require( './props/is-defined/set.js' ); -var getIsDefined = require( './props/is-defined/get.js' ); -var setLabel = require( './props/label/set.js' ); -var getLabel = require( './props/label/get.js' ); -var push = require( './push.js' ); -var render = require( './render' ); -var stub = require( './render/stub.js' ); -var toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare - - -// VARIABLES // - -var debug = logger( 'sparkline:main' ); - -var merge = mergeFcn({ - 'extend': false -}); - -// List of private properties (note: keep in alphabetical order): -var PRIVATE_PROPS = [ - '_autoRender', - '_bufferSize', - '_data', - '_description', - '_isDefined', - '_labels' -]; - - -// MAIN // - -/** -* Sparkline constructor. -* -* @constructor -* @param {(Collection|ndarrayLike)} [data] - sparkline data -* @param {Options} [options] - sparkline options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(Collection|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - sparkline description -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @throws {TypeError} must provide valid options -* @returns {Sparkline} sparkline instance -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = Sparkline( data ); -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* var opts = { -* 'data': data -* }; -* var chart = Sparkline( opts ); -*/ -function Sparkline() { - var options; - var nargs; - var opts; - var keys; - var self; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof Sparkline) ) { - if ( nargs === 0 ) { - return new Sparkline(); - } - if ( nargs === 1 ) { - return new Sparkline( arguments[ 0 ] ); - } - return new Sparkline( arguments[ 0 ], arguments[ 1 ] ); - } - self = this; - - opts = defaults(); - if ( nargs === 0 ) { - options = {}; - } else if ( nargs === 1 ) { - if ( isCollection( arguments[ 0 ] ) ) { - options = { - 'data': arguments[ 0 ] - }; - } else { - options = arguments[ 0 ]; - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - } - } else { - if ( !isObject( arguments[ 1 ] ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', arguments[ 1 ] ) ); - } - options = arguments[ 1 ]; - options.data = arguments[ 0 ]; - } - opts = merge( opts, options ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( opts ) ); - EventEmitter.call( this ); - - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - - // Set options... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - - // Add event listeners: - this.on( 'change', onChange ); - this.on( 'render', onRender ); - - return this; - - /** - * Callback invoked upon receiving a `change` event. - * - * @private - */ - function onChange() { - /* eslint-disable no-underscore-dangle */ - debug( 'Received a change event.' ); - if ( self._autoRender ) { - self.render(); - } - } - - /** - * Callback invoked upon receiving a `render` event. - * - * @private - * @param {*} chart - rendered chart - */ - function onRender() { - debug( 'Received a render event.' ); - } -} - -/* -* Inherit from the `EventEmitter` prototype. -*/ -inherit( Sparkline, EventEmitter ); - -/** -* Rendering mode. -* -* ## Notes -* -* - If `true`, an instance re-renders on each `change` event. -* -* @name autoRender -* @memberof Sparkline.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var chart = new Sparkline({ -* 'autoRender': true -* }); -* -* var mode = chart.autoRender; -* // returns true -*/ -defineProperty( Sparkline.prototype, 'autoRender', { - 'configurable': false, - 'enumerable': true, - 'set': setAutoRender, - 'get': getAutoRender -}); - -/** -* Size of data buffer. -* -* @name bufferSize -* @memberof Sparkline.prototype -* @type {(PositiveInteger|null)} -* @throws {TypeError} must be a positive integer or null -* @throws {RangeError} must be greater than or equal to the number of data elements -* -* @example -* var chart = new Sparkline(); -* chart.bufferSize = 20; -* -* @example -* var chart = new Sparkline({ -* 'bufferSize': 25 -* }); -* var size = chart.bufferSize; -* // returns 25 -*/ -defineProperty( Sparkline.prototype, 'bufferSize', { - 'configurable': false, - 'enumerable': true, - 'set': setBufferSize, - 'get': getBufferSize -}); - -/** -* Sparkline data. -* -* @name data -* @memberof Sparkline.prototype -* @type {(ArrayLikeObject|ndarrayLike)} -* @throws {TypeError} must be an array-like object or an ndarray -* @throws {RangeError} length must not exceed maximum data buffer size -* -* @example -* var chart = new Sparkline(); -* chart.data = [ 1.0, 0.0, 3.14, 2.0, 5.0 ]; -* -* @example -* var data = [ 1.0, 0.0, 3.14, 2.0, 5.0 ]; -* var chart = new Sparkline({ -* 'data': data -* }); -* var d = chart.data; -* // returns [ 1.0, 0.0, 3.14, 2.0, 5.0 ] -*/ -defineProperty( Sparkline.prototype, 'data', { - 'configurable': false, - 'enumerable': true, - 'set': setData, - 'get': getData -}); - -/** -* Sparkline description. -* -* @name description -* @memberof Sparkline.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default '' -* -* @example -* var chart = new Sparkline(); -* chart.description = 'Average daily stock market index for the past year.'; -* -* @example -* var chart = new Sparkline({ -* 'description': 'A description.' -* }); -* var desc = chart.description; -* // returns 'A description.' -*/ -defineProperty( Sparkline.prototype, 'description', { - 'configurable': false, - 'enumerable': true, - 'set': setDescription, - 'get': getDescription -}); - -/** -* Accessor which defines whether a datum is defined. -* -* ## Notes -* -* - This accessor is used to define how missing values are encoded. The default behavior is to ignore values which are `NaN`. -* -* @name isDefined -* @memberof Sparkline.prototype -* @type {Function} -* @param {*} d - datum -* @param {integer} i - index -* @throws {TypeError} must be a function -* -* @example -* var chart = new Sparkline(); -* chart.isDefined = function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* -* @example -* function isDefined( d ) { -* // Check for `NaN`: -* return ( d === d ); -* } -* var chart = new Sparkline({ -* 'isDefined': isDefined -* }); -* var fcn = chart.isDefined; -* // returns -*/ -defineProperty( Sparkline.prototype, 'isDefined', { - 'configurable': false, - 'enumerable': true, - 'set': setIsDefined, - 'get': getIsDefined -}); - -/** -* Data label. -* -* @name label -* @memberof Sparkline.prototype -* @type {string} -* @throws {TypeError} must be a string -* @default '' -* -* @example -* var chart = new Sparkline(); -* chart.label = 'beep'; -* -* @example -* var chart = new Sparkline({ -* 'label': 'beep' -* }); -* var label = chart.label; -* // returns 'beep' -*/ -defineProperty( Sparkline.prototype, 'label', { - 'configurable': false, - 'enumerable': true, - 'set': setLabel, - 'get': getLabel -}); - -/** -* Appends data. -* -* @name push -* @memberof Sparkline.prototype -* @type {Function} -* @param {*} datum - data to append -* @returns {Sparkline} chart instance -* -* @example -* var data = [ 1.0, 0.0, 3.14, 2.0, 5.0 ]; -* -* var chart = new Sparkline({ -* 'data': data -* }); -* -* chart.push( 6.0 ).push( -3.14 ).push( -1.0 ); -*/ -Sparkline.prototype.push = push; - -/** -* Renders a sparkline. -* -* @name render -* @memberof Sparkline.prototype -* @type {Function} -* @returns {string} rendered sparkline -*/ -Sparkline.prototype.render = render; - -/** -* Renders a sparkline. -* -* ## Notes -* -* - This method **should** be implemented by descendants. -* -* @private -* @name _render -* @memberof Sparkline.prototype -* @type {Function} -* @returns {string} rendered sparkline -*/ -Sparkline.prototype._render = stub; - -/** -* Serializes a sparkline as a string. -* -* @name toString -* @memberof Sparkline.prototype -* @type {Function} -* @returns {string} serialized sparkline -*/ -Sparkline.prototype.toString = toString; - -// TODO: stub `toJSON` method, which, similar to `render`, should be implemented by descendants, as will be chart type specific - - -// EXPORTS // - -module.exports = Sparkline; diff --git a/sparklines/base/ctor/lib/props/auto-render/get.js b/sparklines/base/ctor/lib/props/auto-render/get.js deleted file mode 100644 index 7df40de..0000000 --- a/sparklines/base/ctor/lib/props/auto-render/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the rendering mode. -* -* @private -* @returns {boolean} rendering mode -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._autoRender; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/auto-render/set.js b/sparklines/base/ctor/lib/props/auto-render/set.js deleted file mode 100644 index e899788..0000000 --- a/sparklines/base/ctor/lib/props/auto-render/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:set:auto-render' ); - - -// MAIN // - -/** -* Sets the rendering mode. -* -* @private -* @param {boolean} bool - boolean indicating whether to re-render on a change event -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'autoRender', bool ) ); - } - if ( bool !== this._autoRender ) { - debug( 'Current value: %d.', this._autoRender ); - - this._autoRender = bool; - debug( 'New Value: %d.', this._autoRender ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/props/buffer-size/get.js b/sparklines/base/ctor/lib/props/buffer-size/get.js deleted file mode 100644 index 7687400..0000000 --- a/sparklines/base/ctor/lib/props/buffer-size/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data buffer size. -* -* @private -* @returns {number} data buffer size -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._bufferSize; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/buffer-size/set.js b/sparklines/base/ctor/lib/props/buffer-size/set.js deleted file mode 100644 index ba0a629..0000000 --- a/sparklines/base/ctor/lib/props/buffer-size/set.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:set:buffer-size' ); - - -// MAIN // - -/** -* Sets the data buffer size. -* -* @param {(PositiveInteger|null)} size - data buffer size -* @throws {TypeError} must be a positive integer or null -* @throws {RangeError} must be greater than or equal to the number of data elements -*/ -function set( size ) { - /* eslint-disable no-invalid-this */ - var FLG = isNull( size ); - if ( !isPositiveInteger( size ) && !FLG ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a positive integer or null. Value: `%s`.', 'bufferSize', size ) ); - } - if ( FLG ) { - size = FLOAT64_MAX; - } - if ( this._data && size < this._data.length ) { - throw new RangeError( format( 'invalid assignment. `%s` size is less than the number of data elements. Number of elements: `%u`. Value: `%u`.', 'bufferSize', this._data.length, size ) ); - } - if ( size !== this._bufferSize ) { - debug( 'Current value: %s.', this._bufferSize ); - - this._bufferSize = size; - debug( 'New value: %s.', this._bufferSize ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/props/data/get.js b/sparklines/base/ctor/lib/props/data/get.js deleted file mode 100644 index c42a909..0000000 --- a/sparklines/base/ctor/lib/props/data/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns sparkline data. -* -* @private -* @returns {Array} sparkline data -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._data.slice(); -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/data/set.js b/sparklines/base/ctor/lib/props/data/set.js deleted file mode 100644 index cfcc099..0000000 --- a/sparklines/base/ctor/lib/props/data/set.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isCollection = require( '@stdlib/assert/is-collection' ); -var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:set:data' ); - - -// MAIN // - -/** -* Sets the sparkline data. -* -* @private -* @param {(Collection|ndarrayLike)} data - sparkline data -* @throws {TypeError} must be an array-like object or an ndarray -* @throws {RangeError} length must not exceed maximum data buffer size -*/ -function set( data ) { - /* eslint-disable no-invalid-this */ - var FLG; - var i; - - FLG = isndarrayLike( data ) && typeof data.iget === 'function'; - if ( !isCollection( data ) && !FLG ) { - throw new TypeError( format( 'invalid assignment. `%s` must be an array-like object or an ndarray. Value: `%s`.', 'data', data ) ); - } - if ( data.length > this._bufferSize ) { - throw new RangeError( format( 'invalid assignment. `%s` length exceeds maximum data buffer size. Buffer size: `%u`. Length: `%u`.', 'data', this._bufferSize, data.length ) ); - } - debug( 'Current value: %s.', JSON.stringify( this._data ) ); - - this._data = []; - if ( FLG ) { - for ( i = 0; i < data.length; i++ ) { - this._data.push( data.iget( i ) ); - } - } else { - for ( i = 0; i < data.length; i++ ) { - this._data.push( data[ i ] ); - } - } - debug( 'New value: %s.', JSON.stringify( this._data ) ); - this.emit( 'change' ); -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/props/description/get.js b/sparklines/base/ctor/lib/props/description/get.js deleted file mode 100644 index d67c978..0000000 --- a/sparklines/base/ctor/lib/props/description/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the description. -* -* @private -* @returns {string} description -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._description; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/description/set.js b/sparklines/base/ctor/lib/props/description/set.js deleted file mode 100644 index 445c0ba..0000000 --- a/sparklines/base/ctor/lib/props/description/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'plot:set:description' ); - - -// MAIN // - -/** -* Sets the description. -* -* @private -* @param {string} str - description -* @throws {TypeError} must be a string -* @returns {void} -*/ -function set( str ) { - /* eslint-disable no-invalid-this */ - if ( !isString( str ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'description', str ) ); - } - if ( str !== this._description ) { - debug( 'Current value: %s.', this._description ); - - this._description = str; - debug( 'New value: %s.', this._description ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/props/is-defined/get.js b/sparklines/base/ctor/lib/props/is-defined/get.js deleted file mode 100644 index fd05f22..0000000 --- a/sparklines/base/ctor/lib/props/is-defined/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the accessor for defined values. -* -* @private -* @returns {Function} accessor -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._isDefined; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/is-defined/set.js b/sparklines/base/ctor/lib/props/is-defined/set.js deleted file mode 100644 index 275ed62..0000000 --- a/sparklines/base/ctor/lib/props/is-defined/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:set:is-defined' ); - - -// MAIN // - -/** -* Sets the accessor for defined values. -* -* @private -* @param {Function} fcn - accessor -* @throws {TypeError} must be a function -* @returns {void} -*/ -function set( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'isDefined', fcn ) ); - } - if ( fcn !== this._isDefined ) { - debug( 'Current value: %s.', this._isDefined ); - - this._isDefined = fcn; - debug( 'New Value: %s.', this._isDefined ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/props/label/get.js b/sparklines/base/ctor/lib/props/label/get.js deleted file mode 100644 index 0288e4e..0000000 --- a/sparklines/base/ctor/lib/props/label/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the data label. -* -* @private -* @returns {string} label -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._label; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/base/ctor/lib/props/label/set.js b/sparklines/base/ctor/lib/props/label/set.js deleted file mode 100644 index cb2b7d5..0000000 --- a/sparklines/base/ctor/lib/props/label/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:set:label' ); - - -// MAIN // - -/** -* Sets the data label. -* -* @private -* @param {string} label - data label -* @throws {TypeError} must be a string -* @returns {void} -*/ -function set( label ) { - /* eslint-disable no-invalid-this */ - if ( !isString( label ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', 'label', label ) ); - } - if ( label !== this._label ) { - debug( 'Current value: %s.', this._label ); - - this._label = label; - debug( 'New Value: %s.', this._label ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/base/ctor/lib/push.js b/sparklines/base/ctor/lib/push.js deleted file mode 100644 index 4ded91d..0000000 --- a/sparklines/base/ctor/lib/push.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:push' ); - - -// MAIN // - -/** -* Appends data. -* -* @private -* @param {*} datum - data to append -* @returns {Sparkline} class instance -*/ -function push( datum ) { - /* eslint-disable no-invalid-this */ - debug( 'Current value: %s.', JSON.stringify( this._data ) ); - if ( this._data.length >= this._bufferSize ) { - this._data.shift(); - } - this._data.push( datum ); - - debug( 'New value: %s.', JSON.stringify( this._data ) ); - this.emit( 'change' ); - - return this; -} - - -// EXPORTS // - -module.exports = push; diff --git a/sparklines/base/ctor/lib/render/index.js b/sparklines/base/ctor/lib/render/index.js deleted file mode 100644 index 4ddc779..0000000 --- a/sparklines/base/ctor/lib/render/index.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:render' ); - - -// MAIN // - -/** -* Renders a sparkline. -* -* @private -* @returns {*} rendered sparkline -*/ -function render() { - /* eslint-disable no-invalid-this */ - var out; - - debug( 'Rendering...' ); - out = this._render(); - - this.emit( 'render', out ); - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/base/ctor/lib/render/stub.js b/sparklines/base/ctor/lib/render/stub.js deleted file mode 100644 index 98180cb..0000000 --- a/sparklines/base/ctor/lib/render/stub.js +++ /dev/null @@ -1,34 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Placeholder `render` function. -* -* @private -* @throws {Error} must be implemented by descendant classes -*/ -function render() { - throw new Error( 'not implemented' ); -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/base/ctor/lib/tostring.js b/sparklines/base/ctor/lib/tostring.js deleted file mode 100644 index 6b456b3..0000000 --- a/sparklines/base/ctor/lib/tostring.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Serializes a sparkline as a string. -* -* @private -* @returns {string} serialized sparkline -*/ -function toString() { // eslint-disable-line stdlib/no-redeclare - /* eslint-disable no-invalid-this */ - return this.render(); -} - - -// EXPORTS // - -module.exports = toString; diff --git a/sparklines/base/ctor/package.json b/sparklines/base/ctor/package.json deleted file mode 100644 index f5e5944..0000000 --- a/sparklines/base/ctor/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/base/ctor", - "version": "0.0.0", - "description": "Base class for sparklines.", - "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" - }, - "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", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis" - ] -} diff --git a/sparklines/base/ctor/test/test.auto_render.js b/sparklines/base/ctor/test/test.auto_render.js deleted file mode 100644 index 620b2bf..0000000 --- a/sparklines/base/ctor/test/test.auto_render.js +++ /dev/null @@ -1,195 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': false - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.strictEqual( sparkline.autoRender, false, 'returns expected value' ); - - sparkline.autoRender = true; - t.strictEqual( sparkline.autoRender, true, 'returns expected value' ); - - sparkline.autoRender = false; - t.strictEqual( sparkline.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - sparkline._render = render; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'render', onRender ); - sparkline.emit( 'change' ); - - function render() { - return '...'; - } - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( str, '...', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'render', onRender ); - sparkline.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': true - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': false - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': true - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'autoRender': false - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/base/ctor/test/test.buffer_size.js b/sparklines/base/ctor/test/test.buffer_size.js deleted file mode 100644 index a65048d..0000000 --- a/sparklines/base/ctor/test/test.buffer_size.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - sparkline.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'bufferSize': 10 - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.strictEqual( sparkline.bufferSize, 10, 'returns expected value' ); - - sparkline.bufferSize = 20; - t.strictEqual( sparkline.bufferSize, 20, 'returns expected value' ); - - sparkline.bufferSize = 30; - t.strictEqual( sparkline.bufferSize, 30, 'returns expected value' ); - - sparkline.bufferSize = null; - t.strictEqual( sparkline.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'bufferSize': 10 - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'bufferSize': 10 - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/base/ctor/test/test.data.js b/sparklines/base/ctor/test/test.data.js deleted file mode 100644 index fa8ad91..0000000 --- a/sparklines/base/ctor/test/test.data.js +++ /dev/null @@ -1,131 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor({ - 'bufferSize': 1 - }); - sparkline.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - var arr; - - arr = [ 1, 2, 3 ]; - sparkline = ctor({ - 'data': arr - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.notEqual( sparkline.data, arr, 'returns a new reference' ); - t.deepEqual( sparkline.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - sparkline.data = arr; - t.notEqual( sparkline.data, arr, 'returns a new reference' ); - t.deepEqual( sparkline.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - sparkline.data = arr; - t.notEqual( sparkline.data, arr, 'returns a new reference' ); - t.deepEqual( sparkline.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'data': [ 1, 2, 3 ] - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/base/ctor/test/test.description.js b/sparklines/base/ctor/test/test.description.js deleted file mode 100644 index a88705b..0000000 --- a/sparklines/base/ctor/test/test.description.js +++ /dev/null @@ -1,117 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'description': 'beep' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.strictEqual( sparkline.description, 'beep', 'returns expected value' ); - - sparkline.description = 'boop'; - t.strictEqual( sparkline.description, 'boop', 'returns expected value' ); - - sparkline.description = 'foo'; - t.strictEqual( sparkline.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'description': 'beep' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'description': 'beep' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/base/ctor/test/test.is_defined.js b/sparklines/base/ctor/test/test.is_defined.js deleted file mode 100644 index 91bb53a..0000000 --- a/sparklines/base/ctor/test/test.is_defined.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'isDefined': noop - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.strictEqual( sparkline.isDefined, noop, 'returns expected value' ); - - sparkline.isDefined = isDefined; - t.strictEqual( sparkline.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var sparkline = ctor(); - t.strictEqual( sparkline.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( sparkline.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'isDefined': noop - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'isDefined': noop - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/base/ctor/test/test.js b/sparklines/base/ctor/test/test.js deleted file mode 100644 index 9c3c6fb..0000000 --- a/sparklines/base/ctor/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Sparkline = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Sparkline, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var sparkline = new Sparkline(); - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/base/ctor/test/test.label.js b/sparklines/base/ctor/test/test.label.js deleted file mode 100644 index b0ec6e0..0000000 --- a/sparklines/base/ctor/test/test.label.js +++ /dev/null @@ -1,115 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = ctor(); - sparkline.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'label': 'beep' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - t.strictEqual( sparkline.label, 'beep', 'returns expected value' ); - - sparkline.label = 'boop'; - t.strictEqual( sparkline.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'label': 'a' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'label': 'a' - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/base/ctor/test/test.main.js b/sparklines/base/ctor/test/test.main.js deleted file mode 100644 index 4644c5a..0000000 --- a/sparklines/base/ctor/test/test.main.js +++ /dev/null @@ -1,335 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var Sparkline = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Sparkline, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var sparkline = new Sparkline(); - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var sparkline; - var ctor; - - ctor = Sparkline; - sparkline = ctor(); - - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var sparkline; - var ctor; - - ctor = Sparkline; - sparkline = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var sparkline; - var ctor; - - ctor = Sparkline; - sparkline = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var sparkline; - var ctor; - - ctor = Sparkline; - sparkline = ctor( [ 1, 2, 3 ], { - 'description': 'beep', - 'bufferSize': 10, - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( sparkline instanceof Sparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = new Sparkline( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var sparkline = new Sparkline( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var sparkline = new Sparkline({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var sparkline = new Sparkline( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var sparkline = new Sparkline({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var sparkline = new Sparkline( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var sparkline; - var expected; - var opts; - - sparkline = new Sparkline(); - t.strictEqual( sparkline.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - sparkline = new Sparkline( opts ); - - expected = true; - t.strictEqual( sparkline.autoRender, expected, 'returns expected value' ); - - sparkline.autoRender = false; - - expected = false; - t.strictEqual( sparkline.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var sparkline; - var opts; - - sparkline = new Sparkline(); - t.strictEqual( sparkline.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - sparkline = new Sparkline( opts ); - t.strictEqual( sparkline.bufferSize, opts.bufferSize, 'returns expected value' ); - - sparkline.bufferSize = 5; - t.strictEqual( sparkline.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var sparkline; - var expected; - var opts; - - sparkline = new Sparkline(); - t.deepEqual( sparkline.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - sparkline = new Sparkline( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( sparkline.data, expected, 'returns expected value' ); - - sparkline.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( sparkline.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var sparkline; - var expected; - var opts; - - sparkline = new Sparkline(); - t.strictEqual( typeof sparkline.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - sparkline = new Sparkline( opts ); - - expected = noop; - t.deepEqual( sparkline.isDefined, expected, 'returns expected value' ); - - sparkline.isDefined = noop; - - expected = noop; - t.deepEqual( sparkline.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var sparkline; - var expected; - var opts; - - sparkline = new Sparkline(); - t.strictEqual( sparkline.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - sparkline = new Sparkline( opts ); - - expected = 'foo'; - t.strictEqual( sparkline.label, expected, 'returns expected value' ); - - sparkline.label = 'bar'; - - expected = 'bar'; - t.strictEqual( sparkline.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var sparkline = new Sparkline(); - t.strictEqual( typeof sparkline.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a sparkline', function test( t ) { - var sparkline = new Sparkline(); - t.strictEqual( typeof sparkline.render, 'function', 'has render method' ); - t.end(); -}); - -tape( 'an instance has a `toString` method for serializing a sparkline to a string', function test( t ) { - var sparkline = new Sparkline(); - t.strictEqual( typeof sparkline.toString, 'function', 'has toString method' ); - t.end(); -}); diff --git a/sparklines/base/ctor/test/test.push.js b/sparklines/base/ctor/test/test.push.js deleted file mode 100644 index 341573b..0000000 --- a/sparklines/base/ctor/test/test.push.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the sparkline data', function test( t ) { - var sparkline; - var expected; - var data; - var v; - - data = [ 1, 2, 3 ]; - sparkline = ctor({ - 'data': data - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.push( 4 ); - v = sparkline.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to sparkline data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the sparkline data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var sparkline; - var expected; - var data; - var v; - - data = [ 1, 2, 3 ]; - sparkline = ctor({ - 'data': data, - 'bufferSize': 3 - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.push( 4 ); - v = sparkline.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'data': [ 1, 2, 3 ] - }); - sparkline._render = noop; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'change', onChange ); - sparkline.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/base/ctor/test/test.render.js b/sparklines/base/ctor/test/test.render.js deleted file mode 100644 index 7d3b6ea..0000000 --- a/sparklines/base/ctor/test/test.render.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the `render` method throws an error if instances or child classes do not implement a `_render` method', function test( t ) { - var sparkline = ctor(); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - sparkline.render(); - } -}); - -tape( 'the `render` method emits a `render` event upon rendering', function test( t ) { - var sparkline; - - sparkline = ctor({ - 'data': [ 1, 2, 3 ] - }); - sparkline._render = render; // eslint-disable-line no-underscore-dangle - - sparkline.on( 'render', onRender ); - sparkline.render(); - - function render() { - return '...'; - } - - function onRender( str ) { - t.ok( true, 'triggers event' ); - t.strictEqual( str, '...', 'provides expected value' ); - t.end(); - } -}); diff --git a/sparklines/base/ctor/test/test.tostring.js b/sparklines/base/ctor/test/test.tostring.js deleted file mode 100644 index a7b5bf8..0000000 --- a/sparklines/base/ctor/test/test.tostring.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the `toString` method serializes a sparkline as a string by rendering a sparkline', function test( t ) { - var sparkline; - var str; - - sparkline = ctor(); - sparkline._render = render; // eslint-disable-line no-underscore-dangle - - str = sparkline.toString(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns expected value' ); - - t.end(); - - function render() { - return '▁█▅▃▆▆▅'; - } -}); diff --git a/sparklines/base/examples/index.js b/sparklines/base/examples/index.js deleted file mode 100644 index c7e940d..0000000 --- a/sparklines/base/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/sparklines/base/lib/index.js b/sparklines/base/lib/index.js deleted file mode 100644 index af35d67..0000000 --- a/sparklines/base/lib/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name Sparkline -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/plot/sparklines/base/ctor} -*/ -setReadOnly( ns, 'Sparkline', require( './../../../sparklines/base/ctor' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/sparklines/base/package.json b/sparklines/base/package.json deleted file mode 100644 index 5dfbe71..0000000 --- a/sparklines/base/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/base", - "version": "0.0.0", - "description": "Base (i.e., lower-level) sparkline functionality.", - "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": { - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "standard", - "library", - "std", - "lib", - "sparklines", - "sparkline", - "base", - "plot", - "data", - "vis", - "viz", - "visualization" - ] -} diff --git a/sparklines/base/test/test.js b/sparklines/base/test/test.js deleted file mode 100644 index 14dda1f..0000000 --- a/sparklines/base/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.equal( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.equal( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/sparklines/examples/index.js b/sparklines/examples/index.js deleted file mode 100644 index c7e940d..0000000 --- a/sparklines/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/sparklines/lib/index.js b/sparklines/lib/index.js deleted file mode 100644 index e896110..0000000 --- a/sparklines/lib/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name base -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/plot/sparklines/base} -*/ -setReadOnly( ns, 'base', require( './../../sparklines/base' ) ); - -/** -* @name unicode -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/plot/sparklines/unicode} -*/ -setReadOnly( ns, 'unicode', require( './../../sparklines/unicode' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/sparklines/package.json b/sparklines/package.json deleted file mode 100644 index 9161987..0000000 --- a/sparklines/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines", - "version": "0.0.0", - "description": "Sparklines.", - "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": { - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "standard", - "library", - "std", - "lib", - "sparklines", - "sparkline", - "plot", - "data", - "vis", - "viz", - "visualization", - "unicode" - ] -} diff --git a/sparklines/test/test.js b/sparklines/test/test.js deleted file mode 100644 index 14dda1f..0000000 --- a/sparklines/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.equal( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.equal( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/sparklines/unicode/README.md b/sparklines/unicode/README.md deleted file mode 100644 index 22202e2..0000000 --- a/sparklines/unicode/README.md +++ /dev/null @@ -1,546 +0,0 @@ - - -# Unicode Sparkline - -> Create a Unicode sparkline. - -
- -## Usage - -```javascript -var UnicodeSparkline = require( '@stdlib/plot/sparklines/unicode' ); -``` - -#### UnicodeSparkline( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new UnicodeSparkline(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **infinities**: `boolean` flag indicating whether to encode infinite values. Default: `false`. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. -- **type**: chart type. Default: `'column'`. -- **yMax**: maximum value of the y-axis domain. If set to `null`, the maximum value is computed from the data. -- **yMin**: minimum value of the y-axis domain. If set to `null`, the minimum value is computed from the data. - -* * * - -### Writable Properties - - - -#### UnicodeSparkline.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new UnicodeSparkline(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### UnicodeSparkline.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new UnicodeSparkline(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### UnicodeSparkline.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var chart = new UnicodeSparkline(); - -// Set: -chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); - -// Get: -var data = chart.data; -// returns [ 3.14, 5.0, -3.14, -1.0 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### UnicodeSparkline.prototype.description - -Chart description. - -```javascript -var chart = new UnicodeSparkline(); - -// Set: -chart.description = 'Daily stock prices for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Daily stock prices for the past 30 days.' -``` - - - -#### UnicodeSparkline.prototype.infinities - -`Boolean` flag indicating whether to render infinite values. For certain chart types, when set to `false`, infinite values are considered missing values. Otherwise, for those same chart types, both positive and negative infinity are encoded as `∞`. - -```javascript -var chart = new UnicodeSparkline(); - -chart.infinities = true; - -chart.data = [ - 1.0, - 5.0, - NaN, - Infinity, - 4.0, - -Infinity, - 3.0 -]; - -var str = chart.render(); -// returns '▁█ ∞▆∞▅' -``` - - - -#### UnicodeSparkline.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var chart = new UnicodeSparkline(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is **dependent** on the chart type. - - - -#### UnicodeSparkline.prototype.label - -Data label. - -```javascript -var chart = new UnicodeSparkline(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - - - -#### UnicodeSparkline.prototype.type - -Chart type. - -```javascript -var chart = new UnicodeSparkline(); - -// Set: -chart.type = 'line'; - -// Get: -var type = chart.type; -// returns 'line' -``` - -The following chart types are supported: - -- [`'column'`][@stdlib/plot/sparklines/unicode/column]: column chart (e.g., `▃▆▂▄▁▅▅`). -- [`'line'`][@stdlib/plot/sparklines/unicode/line]: line chart (e.g., `⡈⠑⠢⠔⠒⠒⠒`). -- [`'tristate'`][@stdlib/plot/sparklines/unicode/tristate]: tristate chart (e.g., `▄▀──▀▄▄▀`). -- [`'up-down'`][@stdlib/plot/sparklines/unicode/up-down]: up/down chart (e.g., `↓↑↑↑↑↓↓↑`). -- [`'win-loss'`][@stdlib/plot/sparklines/unicode/win-loss]: win/loss chart (e.g., `┌╵└┴╵╷╷╵`). - - - -#### UnicodeSparkline.prototype.yMin - -Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. - -```javascript -var chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMin = 0.0; - -var str = chart.render(); -// returns '▁█▁▄▁▇▅' -``` - - - -#### UnicodeSparkline.prototype.yMax - -Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. - -```javascript -var chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMax = 10.0; - -var str = chart.render(); -// returns '▃▆▂▄▁▅▅' -``` - -* * * - -### Methods - - - -#### UnicodeSparkline.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new UnicodeSparkline( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### UnicodeSparkline.prototype.render() - -Renders a Unicode sparkline. - -```javascript -var chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.render(); -// returns '▁█▅▃▆▆▅' - -// Render a line chart from the same data: -chart.type = 'line'; - -str = chart.render(); -// returns '⡈⠑⠢⠔⠒⠒⠒' -``` - - - -#### UnicodeSparkline.prototype.toString() - -Serializes a Unicode sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.toString(); -// returns '▁█▅▃▆▆▅' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new UnicodeSparkline(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new UnicodeSparkline(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var sparkline = require( '@stdlib/plot/sparklines/unicode' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a sparkline chart: -chart = sparkline( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu()*100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --type type Chart type. Default: column. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline 1 2 3 4 5 6 -▁▂▄▅▇█ -``` - -```bash -$ echo -n $'1\n2\n3\n4\n5\n6\n' | sparkline --ymax 3 -▁▅████ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/benchmark/benchmark.js b/sparklines/unicode/benchmark/benchmark.js deleted file mode 100644 index 7a1f95e..0000000 --- a/sparklines/unicode/benchmark/benchmark.js +++ /dev/null @@ -1,396 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var UnicodeSparkline = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UnicodeSparkline(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = UnicodeSparkline; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'type': 'line', - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UnicodeSparkline( opts ); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UnicodeSparkline( [ 1, 2, 3 ] ); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'type': 'line', - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UnicodeSparkline( [ 1, 2, 3 ], opts ); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UnicodeSparkline ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:infinities', function benchmark( b ) { - var bool; - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.infinities = !bool; - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:type', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'column', - 'line', - 'tristate', - 'up-down', - 'win-loss' - ]; - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.type = values[ i % values.length ]; - if ( typeof v.type !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.type !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMax', function benchmark( b ) { - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMax = i; - if ( v.yMax !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMax !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMin', function benchmark( b ) { - var v; - var i; - - v = new UnicodeSparkline(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMin = i; - if ( v.yMin !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMin !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/benchmark/benchmark.render.js b/sparklines/unicode/benchmark/benchmark.render.js deleted file mode 100644 index b2a732c..0000000 --- a/sparklines/unicode/benchmark/benchmark.render.js +++ /dev/null @@ -1,230 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var UnicodeSparkline = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {UnicodeSparkline} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var datum; - var x; - var i; - - x = new Float64Array( len ); - if ( chart.type === 'column' || chart.type === 'line' ) { - datum = randu; - } else if ( chart.type === 'tristate' ) { - datum = tristate; - } else if ( chart.type === 'win-loss' ) { - datum = winloss; - } else { - datum = updown; - } - for ( i = 0; i < x.length; i++ ) { - x[ i ] = datum(); - } - chart.data = x; - return benchmark; - - /** - * Returns a tristate chart datum. - * - * @private - * @returns {number} datum - */ - function tristate() { - var r = randu(); - if ( r > 0.66 ) { - return 1; - } - if ( r > 0.33 ) { - return 0; - } - return -1; - } - - /** - * Returns a win-loss chart datum. - * - * @private - * @returns {number} datum - */ - function winloss() { - var r = randu(); - if ( r > 0.66 ) { - return 2; - } - if ( r > 0.33 ) { - return 1; - } - if ( r > 0.15 ) { - return -1; - } - return -2; - } - - /** - * Returns an up-down chart datum. - * - * @private - * @returns {number} datum - */ - function updown() { - var r = randu(); - if ( r > 0.5 ) { - return 1; - } - return -1; - } - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( datum() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new UnicodeSparkline({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=default,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'yMin': 0.0, - 'yMax': 1.0 - }); - f = createBenchmark( len, chart ); - bench( pkg+'::ymin,ymax:render:type=default,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'column' - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=column,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'column', - 'yMin': 0.0, - 'yMax': 1.0 - }); - f = createBenchmark( len, chart ); - bench( pkg+'::ymin,ymax:render:type=column,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'line' - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=line,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'line', - 'yMin': 0.0, - 'yMax': 1.0 - }); - f = createBenchmark( len, chart ); - bench( pkg+'::ymin,ymax:render:type=line,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'tristate' - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=tristate,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'up-down' - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=up-down,len='+len, f ); - - chart = new UnicodeSparkline({ - 'bufferSize': len, - 'type': 'win-loss' - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:type=win-loss,len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/bin/cli b/sparklines/unicode/bin/cli deleted file mode 100755 index ce6e4c2..0000000 --- a/sparklines/unicode/bin/cli +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - // Get any provided command-line flags: - if ( flags.type ) { - opts.type = flags.type; - } - if ( flags.ymin ) { - opts.yMin = parseFloat( flags.ymin ); - } - if ( flags.ymax ) { - opts.yMax = parseFloat( flags.ymax ); - } - if ( flags.infinities ) { - opts.infinities = flags.infinities; - } - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/column/README.md b/sparklines/unicode/column/README.md deleted file mode 100644 index 37caef1..0000000 --- a/sparklines/unicode/column/README.md +++ /dev/null @@ -1,513 +0,0 @@ - - -# Column Chart - -> Create a Unicode sparkline column chart. - -
- -## Usage - -```javascript -var ColumnChart = require( '@stdlib/plot/sparklines/unicode/column' ); -``` - -#### ColumnChart( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new ColumnChart(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **infinities**: `boolean` flag indicating whether to encode infinite values. Default: `false`. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. -- **yMax**: maximum value of the y-axis domain. If set to `null`, the maximum value is computed from the data. -- **yMin**: minimum value of the y-axis domain. If set to `null`, the minimum value is computed from the data. - -* * * - -### Writable Properties - - - -#### ColumnChart.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new ColumnChart(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### ColumnChart.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new ColumnChart(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### ColumnChart.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var chart = new ColumnChart(); - -// Set: -chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); - -// Get: -var data = chart.data; -// returns [ 3.14, 5.0, -3.14, -1.0 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### ColumnChart.prototype.description - -Chart description. - -```javascript -var chart = new ColumnChart(); - -// Set: -chart.description = 'Daily stock prices for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Daily stock prices for the past 30 days.' -``` - - - -#### ColumnChart.prototype.infinities - -`Boolean` flag indicating whether to render infinite values. When set to `false`, infinite values are considered missing values. When set to `true`, both positive and negative infinity are encoded as `∞`. - -```javascript -var chart = new ColumnChart(); - -chart.infinities = true; - -chart.data = [ - 1.0, - 5.0, - NaN, - Infinity, - 4.0, - -Infinity, - 3.0 -]; - -var str = chart.render(); -// returns '▁█ ∞▆∞▅' -``` - - - -#### ColumnChart.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var chart = new ColumnChart(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is to ignore values which are `NaN`. - - - -#### ColumnChart.prototype.label - -Data label. - -```javascript -var chart = new ColumnChart(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - - - -#### ColumnChart.prototype.yMin - -Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. - -```javascript -var chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMin = 0.0; - -var str = chart.render(); -// returns '▁█▁▄▁▇▅' -``` - - - -#### ColumnChart.prototype.yMax - -Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. - -```javascript -var chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMax = 10.0; - -var str = chart.render(); -// returns '▃▆▂▄▁▅▅' -``` - -* * * - -### Methods - - - -#### ColumnChart.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new ColumnChart( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### ColumnChart.prototype.render() - -Renders a column chart sparkline. - -```javascript -var chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.render(); -// returns '▁█▅▃▆▆▅' -``` - - - -#### ColumnChart.prototype.toString() - -Serializes a column chart sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.toString(); -// returns '▁█▅▃▆▆▅' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new ColumnChart(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new ColumnChart(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var columnChart = require( '@stdlib/plot/sparklines/unicode/column' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a new column chart: -chart = columnChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu()*100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline-column [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline-column --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline-column --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline-column 1 2 3 4 5 6 -▁▂▄▅▇█ -``` - -```bash -$ echo -n $'1\n2\n3\n4\n5\n6\n' | sparkline-column --ymax 3 -▁▅████ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/column/benchmark/benchmark.js b/sparklines/unicode/column/benchmark/benchmark.js deleted file mode 100644 index 1c357dc..0000000 --- a/sparklines/unicode/column/benchmark/benchmark.js +++ /dev/null @@ -1,365 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var ColumnChart = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new ColumnChart(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = ColumnChart; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new ColumnChart( opts ); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new ColumnChart( [ 1, 2, 3 ] ); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new ColumnChart( [ 1, 2, 3 ], opts ); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof ColumnChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:infinities', function benchmark( b ) { - var bool; - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.infinities = !bool; - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMax', function benchmark( b ) { - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMax = i; - if ( v.yMax !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMax !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMin', function benchmark( b ) { - var v; - var i; - - v = new ColumnChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMin = i; - if ( v.yMin !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMin !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/column/benchmark/benchmark.render.js b/sparklines/unicode/column/benchmark/benchmark.render.js deleted file mode 100644 index b5fdef4..0000000 --- a/sparklines/unicode/column/benchmark/benchmark.render.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var ColumnChart = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {ColumnChart} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = randu(); - } - chart.data = x; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( randu() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new ColumnChart({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:len='+len, f ); - - chart = new ColumnChart({ - 'bufferSize': len, - 'yMin': 0.0, - 'yMax': 1.0 - }); - f = createBenchmark( len, chart ); - bench( pkg+'::ymin,ymax:render:len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/column/bin/cli b/sparklines/unicode/column/bin/cli deleted file mode 100755 index 8eae57e..0000000 --- a/sparklines/unicode/column/bin/cli +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - if ( flags.ymin ) { - opts.yMin = parseFloat( flags.ymin ); - } - if ( flags.ymax ) { - opts.yMax = parseFloat( flags.ymax ); - } - if ( flags.infinities ) { - opts.infinities = flags.infinities; - } - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/column/docs/repl.txt b/sparklines/unicode/column/docs/repl.txt deleted file mode 100644 index 90a5268..0000000 --- a/sparklines/unicode/column/docs/repl.txt +++ /dev/null @@ -1,95 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a sparkline column chart instance. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.infinities: boolean (optional) - Boolean indicating whether to encode infinite values. Default: false. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - options.yMax: number|null (optional) - Maximum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - options.yMin: number|null (optional) - Minimum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - Returns - ------- - chart: ColumnChart - Column chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.infinities - Indicates whether to encode infinite values. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - chart.render() - Renders a column chart sparkline. - - chart.yMax - Maximum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - chart.yMin - Minimum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - Examples - -------- - > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '▁█▅▃▆▆▅' - - See Also - -------- - diff --git a/sparklines/unicode/column/docs/usage.txt b/sparklines/unicode/column/docs/usage.txt deleted file mode 100644 index 54690d0..0000000 --- a/sparklines/unicode/column/docs/usage.txt +++ /dev/null @@ -1,11 +0,0 @@ - -Usage: sparkline-column [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. diff --git a/sparklines/unicode/column/etc/cli_opts.json b/sparklines/unicode/column/etc/cli_opts.json deleted file mode 100644 index d11e5f6..0000000 --- a/sparklines/unicode/column/etc/cli_opts.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - "split", - "ymin", - "ymax" - ], - "boolean": [ - "help", - "version", - "infinities" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/column/examples/index.js b/sparklines/unicode/column/examples/index.js deleted file mode 100644 index 44d0257..0000000 --- a/sparklines/unicode/column/examples/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var columnChart = require( './../lib' ); - -var chart; -var data; -var opts; -var str; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Set chart options: -opts = { - 'infinities': true -}; - -// Create a new column chart: -chart = columnChart( data, opts ); - -// Render the chart as a string: -str = chart.render(); - -console.log( str ); -// => '...' diff --git a/sparklines/unicode/column/examples/update.js b/sparklines/unicode/column/examples/update.js deleted file mode 100644 index a87cea5..0000000 --- a/sparklines/unicode/column/examples/update.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var columnChart = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a new column chart: -chart = columnChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu() * 100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/column/lib/defaults.js b/sparklines/unicode/column/lib/defaults.js deleted file mode 100644 index 7a94618..0000000 --- a/sparklines/unicode/column/lib/defaults.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var out = {}; - - // Boolean indicating whether to encode infinite values: - out.infinities = false; - - // Maximum value of the y-axis domain: - out.yMax = null; - - // Minimum value of the y-axis domain: - out.yMin = null; - - return out; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/sparklines/unicode/column/lib/index.js b/sparklines/unicode/column/lib/index.js deleted file mode 100644 index 4f2f53e..0000000 --- a/sparklines/unicode/column/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline column chart. -* -* @module @stdlib/plot/sparklines/unicode/column -* -* @example -* var columnChart = require( '@stdlib/plot/sparklines/unicode/column' ); -* -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = columnChart( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/column/lib/main.js b/sparklines/unicode/column/lib/main.js deleted file mode 100644 index b0299a2..0000000 --- a/sparklines/unicode/column/lib/main.js +++ /dev/null @@ -1,266 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var isCollection = require( '@stdlib/assert/is-collection' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var pick = require( '@stdlib/utils/pick' ); -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../../sparklines/base/ctor' ); -var defaults = require( './defaults.js' ); -var setInfinities = require( './props/infinities/set.js' ); -var getInfinities = require( './props/infinities/get.js' ); -var setYMax = require( './props/y-max/set.js' ); -var getYMax = require( './props/y-max/get.js' ); -var setYMin = require( './props/y-min/set.js' ); -var getYMin = require( './props/y-min/get.js' ); -var render = require( './render.js' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:column-chart:unicode:main' ); - -var merge = mergeFcn({ - 'extend': false -}); - -// List of private properties (note: keep in alphabetical order): -var PRIVATE_PROPS = [ - '_infinities', - '_yMax', - '_yMin' -]; - -// List of options properties (note: keep in alphabetical order): -var OPTIONS_PROPS = [ - 'infinities', - 'yMax', - 'yMin' -]; - - -// MAIN // - -/** -* Unicode sparkline column chart constructor. -* -* @constructor -* @param {(Collection|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(Collection|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {boolean} [options.infinities=false] - boolean indicating whether to encode infinite values -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @param {(FiniteNumber|null)} [options.yMax] - maximum value of the y-axis domain -* @param {(FiniteNumber|null)} [options.yMin] - minimum value of the y-axis domain -* @throws {TypeError} must provide valid options -* @returns {ColumnChart} chart instance -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new ColumnChart( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* var opts = { -* 'data': data -* }; -* var chart = new ColumnChart( opts ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ -function ColumnChart() { - var options; - var nargs; - var opts; - var keys; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof ColumnChart) ) { - if ( nargs === 0 ) { - return new ColumnChart(); - } - if ( nargs === 1 ) { - return new ColumnChart( arguments[ 0 ] ); - } - return new ColumnChart( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - // Extract chart-specific options... - opts = defaults(); - if ( nargs === 1 && !isCollection( arguments[ 0 ] ) ) { - options = arguments[ 0 ]; - } else if ( nargs === 2 ) { - options = arguments[ 1 ]; - } else { - options = {}; - } - opts = merge( opts, pick( options, OPTIONS_PROPS ) ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( options ) ); - - // Initialize private chart-specific properties... - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - - // Set chart-specific properties... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( ColumnChart, Sparkline ); - -/** -* Boolean indicating whether to encode infinite values. -* -* @name infinities -* @memberof ColumnChart.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var chart = new ColumnChart(); -* chart.infinities = true; -* -* @example -* var chart = new ColumnChart({ -* 'infinities': true -* }); -* var bool = chart.infinities; -* // returns true -*/ -defineProperty( ColumnChart.prototype, 'infinities', { - 'configurable': false, - 'enumerable': true, - 'set': setInfinities, - 'get': getInfinities -}); - -/** -* Maximum value of the y-axis domain. -* -* @name yMax -* @memberof ColumnChart.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new ColumnChart(); -* chart.yMax = 100.0; -* -* @example -* var chart = new ColumnChart({ -* 'yMax': 314.0 -* }); -* var ymax = chart.yMax; -* // returns 314.0 -*/ -defineProperty( ColumnChart.prototype, 'yMax', { - 'configurable': false, - 'enumerable': true, - 'set': setYMax, - 'get': getYMax -}); - -/** -* Minimum value of the y-axis domain. -* -* @name yMin -* @memberof ColumnChart.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new ColumnChart(); -* chart.yMin = -100.0; -* -* @example -* var chart = new ColumnChart({ -* 'yMin': 3.14 -* }); -* var ymin = chart.yMin; -* // returns 3.14 -*/ -defineProperty( ColumnChart.prototype, 'yMin', { - 'configurable': false, - 'enumerable': true, - 'set': setYMin, - 'get': getYMin -}); - -/** -* Renders a sparkline column chart. -* -* @private -* @name _render -* @memberof ColumnChart.prototype -* @type {Function} -* @returns {string} rendered sparkline column chart -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new ColumnChart( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ -ColumnChart.prototype._render = render; // eslint-disable-line no-underscore-dangle - - -// EXPORTS // - -module.exports = ColumnChart; diff --git a/sparklines/unicode/column/lib/props/infinities/get.js b/sparklines/unicode/column/lib/props/infinities/get.js deleted file mode 100644 index 15be814..0000000 --- a/sparklines/unicode/column/lib/props/infinities/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a flag indicating whether to encode infinite values. -* -* @private -* @returns {boolean} boolean indicating whether to encode infinite values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._infinities; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/column/lib/props/infinities/set.js b/sparklines/unicode/column/lib/props/infinities/set.js deleted file mode 100644 index 8da396a..0000000 --- a/sparklines/unicode/column/lib/props/infinities/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:column-chart:unicode:set:infinities' ); - - -// MAIN // - -/** -* Sets a flag indicating whether to encode infinite values. -* -* @private -* @param {boolean} bool - boolean flag -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'infinities', bool ) ); - } - if ( bool !== this._infinities ) { - debug( 'Current value: %s.', this._infinities ); - - this._infinities = bool; - debug( 'New value: %s.', this._infinities ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/column/lib/props/y-max/get.js b/sparklines/unicode/column/lib/props/y-max/get.js deleted file mode 100644 index 8f722bf..0000000 --- a/sparklines/unicode/column/lib/props/y-max/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the maximum value of the y-axis domain. -* -* @private -* @returns {(FiniteNumber|null)} maximum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var max; - var len; - var d; - var i; - - if ( this._yMax === null ) { - len = this._data.length; - max = NINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== PINF && d > max ) { - max = d; - } - } - return max; - } - return this._yMax; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/column/lib/props/y-max/set.js b/sparklines/unicode/column/lib/props/y-max/set.js deleted file mode 100644 index 9adb388..0000000 --- a/sparklines/unicode/column/lib/props/y-max/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:column-chart:unicode:set:y-max' ); - - -// MAIN // - -/** -* Sets the maximum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} max - maximum value -* @throws {TypeError} must be a finite number or null -*/ -function set( max ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( max ) && !isNull( max ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMax', max ) ); - } - if ( max !== this._yMax ) { - debug( 'Current value: %s.', this._yMax ); - - this._yMax = max; - debug( 'New value: %s.', this._yMax ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/column/lib/props/y-min/get.js b/sparklines/unicode/column/lib/props/y-min/get.js deleted file mode 100644 index b084808..0000000 --- a/sparklines/unicode/column/lib/props/y-min/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the minimum value of the y-axis domain. -* -* @private -* @returns {number} minimum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var min; - var len; - var d; - var i; - - if ( this._yMin === null ) { - len = this._data.length; - min = PINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== NINF && d < min ) { - min = d; - } - } - return min; - } - return this._yMin; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/column/lib/props/y-min/set.js b/sparklines/unicode/column/lib/props/y-min/set.js deleted file mode 100644 index 35c7404..0000000 --- a/sparklines/unicode/column/lib/props/y-min/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:column-chart:unicode:set:y-min' ); - - -// MAIN // - -/** -* Sets the minimum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} min - minimum value -* @throws {TypeError} must be a finite number or null -*/ -function set( min ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( min ) && !isNull( min ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMin', min ) ); - } - if ( min !== this._yMin ) { - debug( 'Current value: %s.', this._yMin ); - - this._yMin = min; - debug( 'New value: %s.', this._yMin ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/column/lib/render.js b/sparklines/unicode/column/lib/render.js deleted file mode 100644 index 4fe4a7a..0000000 --- a/sparklines/unicode/column/lib/render.js +++ /dev/null @@ -1,129 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 abs = require( '@stdlib/math/base/special/abs' ); -var round = require( '@stdlib/math/base/special/round' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// VARIABLES // - -// See [Block Elements]{@link https://en.wikipedia.org/wiki/Block_Elements}. -var UNICODE_BLOCK_ELEMENTS = [ - '▁', // U+2581, lower 1/8 - '▂', // U+2582, lower 2/8 - '▃', // U+2583, lower 3/8 - '▄', // U+2584, lower 4/8 - '▅', // U+2585, lower 5/8 - '▆', // U+2586, lower 6/8 - '▇', // U+2587, lower 7/8 - '█' // U+2588, full block -]; -var UNICODE_INF = '∞'; // U+221E -var MISSING_VALUE = ' '; - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var blocks; - var range; - var str; - var min; - var max; - var len; - var idx; - var d; - var v; - var n; - var i; - - len = this._data.length; - if ( len === 0 ) { - return ''; - } - min = this.yMin; - max = this.yMax; - range = abs( max-min ); - - // Check if data is constant... - if ( range === 0.0 ) { - // If `max` is `0`, encode each finite datum as the smallest block glyph... - if ( max === 0.0 ) { - blocks = [ UNICODE_BLOCK_ELEMENTS[ 0 ] ]; - } - // Otherwise, encode each finite datum as a mid-sized block glyph... - else { - blocks = [ UNICODE_BLOCK_ELEMENTS[ 3 ] ]; - } - } else { - blocks = UNICODE_BLOCK_ELEMENTS; - } - // Generate the sparkline chart, assigning a glyph to each datum... - n = blocks.length - 1; - str = ''; - - // TODO: color encoding: one color for both pos and neg or two colors for separate colors - - // TODO: negative values diff color (red) - - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._infinities && ( d === PINF || d === NINF ) ) { - str += UNICODE_INF; - continue; - } - if ( !this._isDefined( d, i ) || d === PINF || d === NINF ) { - str += MISSING_VALUE; - continue; - } - // Normalize the datum (aka feature scaling): - if ( range ) { - v = ( d-min ) / range; - } else { - v = 0.0; - } - // Determine the glyph index: - idx = round( v*n ); - if ( idx < 0 ) { - idx = 0; - } else if ( idx > n ) { - idx = n; - } - // Add the glyph to the chart: - str += blocks[ idx ]; - } - return str; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/column/package.json b/sparklines/unicode/column/package.json deleted file mode 100644 index 334f24a..0000000 --- a/sparklines/unicode/column/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode/column", - "version": "0.0.0", - "description": "Create a Unicode sparkline column chart.", - "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" - } - ], - "bin": { - "sparkline-column": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "column", - "bar", - "histogram", - "hist", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode" - ] -} diff --git a/sparklines/unicode/column/test/fixtures/stdin_error.js.txt b/sparklines/unicode/column/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/column/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/column/test/test.auto_render.js b/sparklines/unicode/column/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/column/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/column/test/test.buffer_size.js b/sparklines/unicode/column/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/column/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.cli.js b/sparklines/unicode/column/test/test.cli.js deleted file mode 100644 index 7fc3cdd..0000000 --- a/sparklines/unicode/column/test/test.cli.js +++ /dev/null @@ -1,363 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders a column chart', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the minimum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymin=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▁▁▃▆█\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the maximum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymax=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▅████\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▃▅▆█∞\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities (disable)', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--no-infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▃▅▆█ \n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf "1\n2\n3\n4\n5\n6"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/column/test/test.data.js b/sparklines/unicode/column/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/column/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/column/test/test.description.js b/sparklines/unicode/column/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/column/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.infinities.js b/sparklines/unicode/column/test/test.infinities.js deleted file mode 100644 index db3e916..0000000 --- a/sparklines/unicode/column/test/test.infinities.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `infinities` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.infinities = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - chart.infinities = true; - t.strictEqual( chart.infinities, true, 'returns expected value' ); - - chart.infinities = false; - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.is_defined.js b/sparklines/unicode/column/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/column/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.js b/sparklines/unicode/column/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/column/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/column/test/test.label.js b/sparklines/unicode/column/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/column/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.main.js b/sparklines/unicode/column/test/test.main.js deleted file mode 100644 index 8472cb6..0000000 --- a/sparklines/unicode/column/test/test.main.js +++ /dev/null @@ -1,559 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var ColumnChart = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ColumnChart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new ColumnChart(); - t.strictEqual( chart instanceof ColumnChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = ColumnChart; - chart = ctor(); - - t.strictEqual( chart instanceof ColumnChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = ColumnChart; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof ColumnChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = ColumnChart; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof ColumnChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = ColumnChart; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof ColumnChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new ColumnChart( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new ColumnChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new ColumnChart({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new ColumnChart( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new ColumnChart({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new ColumnChart( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new ColumnChart( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new ColumnChart( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new ColumnChart( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `infinities` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.infinities, false, 'default value is false' ); - - opts = { - 'infinities': true - }; - chart = new ColumnChart( opts ); - - expected = true; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - chart.infinities = false; - - expected = false; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new ColumnChart( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new ColumnChart( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMax` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.yMax, NINF, 'default value is -infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMax': 10 - }; - chart = new ColumnChart( opts ); - - expected = 10; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - chart.yMax = null; - - expected = 3; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMin` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new ColumnChart(); - t.strictEqual( chart.yMin, PINF, 'default value is +infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMin': 10 - }; - chart = new ColumnChart( opts ); - - expected = 10; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - chart.yMin = null; - - expected = 1; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new ColumnChart(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'by default, a chart renders `NaN` and infinite values as missing values', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ - 1.0, - 5.0, - NaN, - PINF, - NINF, - 4.0, - 3.0 - ]; - - str = chart.render(); - t.strictEqual( str, '▁█ ▆▅', 'returns rendered chart with missing values' ); - - t.end(); -}); - -tape( 'if the `infinities` option/property is set to `true`, the chart encodes infinite values as `∞`', function test( t ) { - var chart; - var str; - - chart = new ColumnChart({ - 'infinities': true - }); - chart.data = [ - 1.0, - 5.0, - NaN, - PINF, - NINF, - 4.0, - 3.0 - ]; - - str = chart.render(); - t.strictEqual( str, '▁█ ∞∞▆▅', 'returns rendered chart with infinities encoded as ∞' ); - - t.end(); -}); - -tape( 'if provided `yMin` and/or `yMax` values, the chart fixes the y-axis domain', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ - -1.0, - 5.0, - -3.0, - 2.0, - -4.0, - 4.0, - 3.0 - ]; - chart.yMin = 0.0; - chart.yMax = 10.0; - - str = chart.render(); - t.strictEqual( str, '▁▅▁▂▁▄▃', 'returns rendered chart with fixed y-axis domain' ); - - chart.data = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; - chart.yMin = null; - chart.yMax = 3.0; - - str = chart.render(); - t.strictEqual( str, '▁▅████', 'returns rendered chart with fixed y-axis domain' ); - - t.end(); -}); - -tape( 'if all datum are `0` and the y-axis domain is `0`, the chart renders each finite datum as the smallest glyph', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]; - - str = chart.render(); - t.strictEqual( str, '▁▁▁▁▁▁▁', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if all datum are constant and non-zero and the y-axis domain is `0`, the chart renders each finite datum as the same mid-sized glyph', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ - 5.0, - 5.0, - 5.0, - 5.0, - 5.0, - 5.0, - 5.0 - ]; - - str = chart.render(); - t.strictEqual( str, '▄▄▄▄▄▄▄', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new ColumnChart(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.toString(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/column/test/test.push.js b/sparklines/unicode/column/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/column/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/column/test/test.y_max.js b/sparklines/unicode/column/test/test.y_max.js deleted file mode 100644 index ca96a99..0000000 --- a/sparklines/unicode/column/test/test.y_max.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMax` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMax = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMax': 10.0 - }); - t.strictEqual( chart.yMax, 10.0, 'returns expected value' ); - - chart.yMax = 20.0; - t.strictEqual( chart.yMax, 20.0, 'returns expected value' ); - - chart.yMax = 30.0; - t.strictEqual( chart.yMax, 30.0, 'returns expected value' ); - - chart.yMax = null; - t.strictEqual( chart.yMax, 3, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMax` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMax` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/column/test/test.y_min.js b/sparklines/unicode/column/test/test.y_min.js deleted file mode 100644 index 470d9a7..0000000 --- a/sparklines/unicode/column/test/test.y_min.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMin` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMin = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMin': 10.0 - }); - t.strictEqual( chart.yMin, 10.0, 'returns expected value' ); - - chart.yMin = 20.0; - t.strictEqual( chart.yMin, 20.0, 'returns expected value' ); - - chart.yMin = 30.0; - t.strictEqual( chart.yMin, 30.0, 'returns expected value' ); - - chart.yMin = null; - t.strictEqual( chart.yMin, 1, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMin` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMin` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/docs/repl.txt b/sparklines/unicode/docs/repl.txt deleted file mode 100644 index 927c242..0000000 --- a/sparklines/unicode/docs/repl.txt +++ /dev/null @@ -1,112 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a Unicode sparkline instance. - - The following chart types are supported: - - - column: column chart (e.g., ▃▆▂▄▁▅▅). - - line: line chart (e.g., ⡈⠑⠢⠔⠒⠒⠒). - - tristate: tristate chart (e.g., ▄▀──▀▄▄▀). - - up-down: up/down chart (e.g., ↓↑↑↑↑↓↓↑). - - win-loss: win/loss chart (e.g., ┌╵└┴╵╷╷╵). - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.infinities: boolean (optional) - Boolean indicating whether to encode infinite values. Default: false. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - options.type: string (optional) - Chart type. Default: 'column'. - - options.yMax: number|null (optional) - Maximum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - options.yMin: number|null (optional) - Minimum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - Returns - ------- - chart: ColumnChart - Column chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.infinities - Indicates whether to encode infinite values. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - chart.render() - Renders a column chart sparkline. - - chart.type - Chart type. - - chart.yMax - Maximum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - chart.yMin - Minimum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - Examples - -------- - > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '▁█▅▃▆▆▅' - > chart.type = 'line'; - > chart.render() - '⡈⠑⠢⠔⠒⠒⠒' - - See Also - -------- - diff --git a/sparklines/unicode/docs/usage.txt b/sparklines/unicode/docs/usage.txt deleted file mode 100644 index 777f8ec..0000000 --- a/sparklines/unicode/docs/usage.txt +++ /dev/null @@ -1,12 +0,0 @@ - -Usage: sparkline [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --type type Chart type. Default: column. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. diff --git a/sparklines/unicode/etc/cli_opts.json b/sparklines/unicode/etc/cli_opts.json deleted file mode 100644 index 6d2ee5e..0000000 --- a/sparklines/unicode/etc/cli_opts.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "string": [ - "split", - "type", - "ymin", - "ymax" - ], - "boolean": [ - "help", - "version", - "infinities" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/examples/index.js b/sparklines/unicode/examples/index.js deleted file mode 100644 index 4b7b761..0000000 --- a/sparklines/unicode/examples/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var sparkline = require( './../lib' ); - -var chart; -var data; -var str; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a sparkline chart: -chart = sparkline( data ); - -// Render the chart as a column chart: -chart.type = 'column'; -str = chart.render(); -console.log( str ); -// => '...' - -// Render the chart as a line chart: -chart.type = 'line'; -str = chart.render(); -console.log( str ); -// => '...' diff --git a/sparklines/unicode/examples/update.js b/sparklines/unicode/examples/update.js deleted file mode 100644 index ce4bd15..0000000 --- a/sparklines/unicode/examples/update.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var sparkline = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a sparkline chart: -chart = sparkline( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu()*100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/lib/defaults.js b/sparklines/unicode/lib/defaults.js deleted file mode 100644 index 80c00ca..0000000 --- a/sparklines/unicode/lib/defaults.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var out = {}; - - // Boolean indicating whether to encode infinite values: - out.infinities = false; - - // Chart type: - out.type = 'column'; - - // Maximum value of the y-axis domain: - out.yMax = null; - - // Minimum value of the y-axis domain: - out.yMin = null; - - return out; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/sparklines/unicode/lib/index.js b/sparklines/unicode/lib/index.js deleted file mode 100644 index c054c4b..0000000 --- a/sparklines/unicode/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline. -* -* @module @stdlib/plot/sparklines/unicode -* -* @example -* var sparkline = require( '@stdlib/plot/sparklines/unicode' ); -* -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = sparkline( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/lib/main.js b/sparklines/unicode/lib/main.js deleted file mode 100644 index 8bc1116..0000000 --- a/sparklines/unicode/lib/main.js +++ /dev/null @@ -1,297 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var isCollection = require( '@stdlib/assert/is-collection' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var pick = require( '@stdlib/utils/pick' ); -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../sparklines/base/ctor' ); -var defaults = require( './defaults.js' ); -var setInfinities = require( './props/infinities/set.js' ); -var getInfinities = require( './props/infinities/get.js' ); -var setType = require( './props/type/set.js' ); -var getType = require( './props/type/get.js' ); -var setYMax = require( './props/y-max/set.js' ); -var getYMax = require( './props/y-max/get.js' ); -var setYMin = require( './props/y-min/set.js' ); -var getYMin = require( './props/y-min/get.js' ); -var render = require( './render.js' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:unicode:main' ); - -var merge = mergeFcn({ - 'extend': false -}); - -// List of private properties (note: keep in alphabetical order): -var PRIVATE_PROPS = [ - '_infinities', - '_type', - '_yMax', - '_yMin' -]; - -// List of options properties (note: keep in alphabetical order): -var OPTIONS_PROPS = [ - 'infinities', - 'type', - 'yMax', - 'yMin' -]; - - -// MAIN // - -/** -* Unicode sparkline constructor. -* -* @constructor -* @param {(Collection|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(Collection|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {boolean} [options.infinities=false] - boolean indicating whether to encode infinite values -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @param {string} [options.type='column'] - chart type -* @param {(FiniteNumber|null)} [options.yMax] - maximum value of the y-axis domain -* @param {(FiniteNumber|null)} [options.yMin] - minimum value of the y-axis domain -* @throws {TypeError} must provide valid options -* @returns {UnicodeSparkline} chart instance -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new UnicodeSparkline( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* var opts = { -* 'data': data -* }; -* var chart = new UnicodeSparkline( opts ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ -function UnicodeSparkline() { - var options; - var nargs; - var opts; - var keys; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof UnicodeSparkline) ) { - if ( nargs === 0 ) { - return new UnicodeSparkline(); - } - if ( nargs === 1 ) { - return new UnicodeSparkline( arguments[ 0 ] ); - } - return new UnicodeSparkline( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - // Extract chart-specific options... - opts = defaults(); - if ( nargs === 1 && !isCollection( arguments[ 0 ] ) ) { - options = arguments[ 0 ]; - } else if ( nargs === 2 ) { - options = arguments[ 1 ]; - } else { - options = {}; - } - opts = merge( opts, pick( options, OPTIONS_PROPS ) ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( options ) ); - - // Initialize private chart-specific properties... - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - - // Set chart-specific properties... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( UnicodeSparkline, Sparkline ); - -/** -* Boolean indicating whether to encode infinite values. -* -* @name infinities -* @memberof UnicodeSparkline.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var chart = new UnicodeSparkline(); -* chart.infinities = true; -* -* @example -* var chart = new UnicodeSparkline({ -* 'infinities': true -* }); -* var bool = chart.infinities; -* // returns true -*/ -defineProperty( UnicodeSparkline.prototype, 'infinities', { - 'configurable': false, - 'enumerable': true, - 'set': setInfinities, - 'get': getInfinities -}); - -/** -* Sparkline chart type. -* -* @name types -* @memberof UnicodeSparkline.prototype -* @type {string} -* @throws {TypeError} must be a supported chart type -* @default 'column' -* -* @example -* var chart = new UnicodeSparkline(); -* chart.type = 'win-loss'; -* -* @example -* var chart = new UnicodeSparkline({ -* 'type': 'win-loss' -* }); -* var type = chart.type; -* // returns 'win-loss' -*/ -defineProperty( UnicodeSparkline.prototype, 'type', { - 'configurable': false, - 'enumerable': true, - 'set': setType, - 'get': getType -}); - -/** -* Maximum value of the y-axis domain. -* -* @name yMax -* @memberof UnicodeSparkline.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new UnicodeSparkline(); -* chart.yMax = 100.0; -* -* @example -* var chart = new UnicodeSparkline({ -* 'yMax': 314.0 -* }); -* var ymax = chart.yMax; -* // returns 314.0 -*/ -defineProperty( UnicodeSparkline.prototype, 'yMax', { - 'configurable': false, - 'enumerable': true, - 'set': setYMax, - 'get': getYMax -}); - -/** -* Minimum value of the y-axis domain. -* -* @name yMin -* @memberof UnicodeSparkline.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new UnicodeSparkline(); -* chart.yMin = -100.0; -* -* @example -* var chart = new UnicodeSparkline({ -* 'yMin': 3.14 -* }); -* var ymin = chart.yMin; -* // returns 3.14 -*/ -defineProperty( UnicodeSparkline.prototype, 'yMin', { - 'configurable': false, - 'enumerable': true, - 'set': setYMin, - 'get': getYMin -}); - -/** -* Renders a sparkline chart. -* -* @name render -* @memberof UnicodeSparkline.prototype -* @type {Function} -* @returns {string} rendered sparkline chart -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new UnicodeSparkline( data ); -* -* var str = chart.render(); -* // returns '▁█▅▃▆▆▅' -*/ -UnicodeSparkline.prototype.render = render; - - -// EXPORTS // - -module.exports = UnicodeSparkline; diff --git a/sparklines/unicode/lib/props/infinities/get.js b/sparklines/unicode/lib/props/infinities/get.js deleted file mode 100644 index 15be814..0000000 --- a/sparklines/unicode/lib/props/infinities/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a flag indicating whether to encode infinite values. -* -* @private -* @returns {boolean} boolean indicating whether to encode infinite values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._infinities; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/lib/props/infinities/set.js b/sparklines/unicode/lib/props/infinities/set.js deleted file mode 100644 index 99b2370..0000000 --- a/sparklines/unicode/lib/props/infinities/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:unicode:set:infinities' ); - - -// MAIN // - -/** -* Sets a flag indicating whether to encode infinite values. -* -* @private -* @param {boolean} bool - boolean flag -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'infinities', bool ) ); - } - if ( bool !== this._infinities ) { - debug( 'Current value: %s.', this._infinities ); - - this._infinities = bool; - debug( 'New value: %s.', this._infinities ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/lib/props/type/chart_types.json b/sparklines/unicode/lib/props/type/chart_types.json deleted file mode 100644 index c135503..0000000 --- a/sparklines/unicode/lib/props/type/chart_types.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "column", - "line", - "tristate", - "up-down", - "win-loss" -] diff --git a/sparklines/unicode/lib/props/type/get.js b/sparklines/unicode/lib/props/type/get.js deleted file mode 100644 index 25585cb..0000000 --- a/sparklines/unicode/lib/props/type/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the sparkline chart type. -* -* @private -* @returns {string} sparkline chart type -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._type; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/lib/props/type/set.js b/sparklines/unicode/lib/props/type/set.js deleted file mode 100644 index 054bd0a..0000000 --- a/sparklines/unicode/lib/props/type/set.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var format = require( '@stdlib/string/format' ); -var CHART_TYPES = require( './chart_types.json' ); - - -// VARIABLES // - -var isChartType = contains( CHART_TYPES ); -var debug = logger( 'sparkline:unicode:set:type' ); - - -// MAIN // - -/** -* Sets the sparkline chart type. -* -* @private -* @param {string} type - chart type -* @throws {TypeError} must be a supported chart type -*/ -function set( type ) { - /* eslint-disable no-invalid-this */ - if ( !isChartType( type ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'type', CHART_TYPES.join( '", "' ), type ) ); - } - if ( type !== this._type ) { - debug( 'Current value: %s.', this._type ); - - this._type = type; - debug( 'New value: %s.', this._type ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/lib/props/y-max/get.js b/sparklines/unicode/lib/props/y-max/get.js deleted file mode 100644 index 8f722bf..0000000 --- a/sparklines/unicode/lib/props/y-max/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the maximum value of the y-axis domain. -* -* @private -* @returns {(FiniteNumber|null)} maximum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var max; - var len; - var d; - var i; - - if ( this._yMax === null ) { - len = this._data.length; - max = NINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== PINF && d > max ) { - max = d; - } - } - return max; - } - return this._yMax; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/lib/props/y-max/set.js b/sparklines/unicode/lib/props/y-max/set.js deleted file mode 100644 index 499f600..0000000 --- a/sparklines/unicode/lib/props/y-max/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:unicode:set:y-max' ); - - -// MAIN // - -/** -* Sets the maximum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} max - maximum value -* @throws {TypeError} must be a finite number or null -*/ -function set( max ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( max ) && !isNull( max ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMax', max ) ); - } - if ( max !== this._yMax ) { - debug( 'Current value: %s.', this._yMax ); - - this._yMax = max; - debug( 'New value: %s.', this._yMax ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/lib/props/y-min/get.js b/sparklines/unicode/lib/props/y-min/get.js deleted file mode 100644 index b084808..0000000 --- a/sparklines/unicode/lib/props/y-min/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the minimum value of the y-axis domain. -* -* @private -* @returns {number} minimum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var min; - var len; - var d; - var i; - - if ( this._yMin === null ) { - len = this._data.length; - min = PINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== NINF && d < min ) { - min = d; - } - } - return min; - } - return this._yMin; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/lib/props/y-min/set.js b/sparklines/unicode/lib/props/y-min/set.js deleted file mode 100644 index 22058cc..0000000 --- a/sparklines/unicode/lib/props/y-min/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:unicode:set:y-min' ); - - -// MAIN // - -/** -* Sets the minimum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} min - minimum value -* @throws {TypeError} must be a finite number or null -*/ -function set( min ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( min ) && !isNull( min ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMin', min ) ); - } - if ( min !== this._yMin ) { - debug( 'Current value: %s.', this._yMin ); - - this._yMin = min; - debug( 'New value: %s.', this._yMin ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/lib/render.js b/sparklines/unicode/lib/render.js deleted file mode 100644 index 3284de7..0000000 --- a/sparklines/unicode/lib/render.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var ColumnChart = require( './../../../sparklines/unicode/column' ); -var LineChart = require( './../../../sparklines/unicode/line' ); -var TristateChart = require( './../../../sparklines/unicode/tristate' ); -var UpDownChart = require( './../../../sparklines/unicode/up-down' ); -var WinLossChart = require( './../../../sparklines/unicode/win-loss' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:unicode:render' ); - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var out; - - debug( 'Rendering...' ); - - switch ( this._type ) { // eslint-disable-line default-case - case 'column': - out = ColumnChart.prototype._render.call( this ); // eslint-disable-line no-underscore-dangle - break; - case 'line': - out = LineChart.prototype._render.call( this ); // eslint-disable-line no-underscore-dangle - break; - case 'tristate': - out = TristateChart.prototype._render.call( this ); // eslint-disable-line no-underscore-dangle - break; - case 'up-down': - out = UpDownChart.prototype._render.call( this ); // eslint-disable-line no-underscore-dangle - break; - case 'win-loss': - out = WinLossChart.prototype._render.call( this ); // eslint-disable-line no-underscore-dangle - break; - } - - this.emit( 'render', out ); - return out; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/line/README.md b/sparklines/unicode/line/README.md deleted file mode 100644 index c1461f9..0000000 --- a/sparklines/unicode/line/README.md +++ /dev/null @@ -1,513 +0,0 @@ - - -# Line Chart - -> Create a Unicode sparkline line chart. - -
- -## Usage - -```javascript -var LineChart = require( '@stdlib/plot/sparklines/unicode/line' ); -``` - -#### LineChart( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new LineChart(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **infinities**: `boolean` flag indicating whether to encode infinite values. Default: `false`. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. -- **yMax**: maximum value of the y-axis domain. If set to `null`, the maximum value is computed from the data. -- **yMin**: minimum value of the y-axis domain. If set to `null`, the minimum value is computed from the data. - -* * * - -### Writable Properties - - - -#### LineChart.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new LineChart(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### LineChart.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new LineChart(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### LineChart.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var chart = new LineChart(); - -// Set: -chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); - -// Get: -var data = chart.data; -// returns [ 3.14, 5.0, -3.14, -1.0 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### LineChart.prototype.description - -Chart description. - -```javascript -var chart = new LineChart(); - -// Set: -chart.description = 'Daily stock prices for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Daily stock prices for the past 30 days.' -``` - - - -#### LineChart.prototype.infinities - -`Boolean` flag indicating whether to render infinite values. When set to `false`, infinite values are considered missing values. When set to `true`, both positive and negative infinity are encoded as `∞`. - -```javascript -var chart = new LineChart(); - -chart.infinities = true; - -chart.data = [ - 1.0, - 5.0, - NaN, - Infinity, - 4.0, - -Infinity, - 3.0 -]; - -var str = chart.render(); -// returns '⡈⠉ ∞⢂∞⠒' -``` - - - -#### LineChart.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var chart = new LineChart(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is to ignore values which are `NaN`. - - - -#### LineChart.prototype.label - -Data label. - -```javascript -var chart = new LineChart(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - - - -#### LineChart.prototype.yMin - -Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. - -```javascript -var chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMin = 0.0; - -var str = chart.render(); -// returns '⡈⢁⡠⢄⡐⠒⠒' -``` - - - -#### LineChart.prototype.yMax - -Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. - -```javascript -var chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); - -chart.yMax = 10.0; - -var str = chart.render(); -// returns '⠔⢂⡠⢄⡐⠒⠒' -``` - -* * * - -### Methods - - - -#### LineChart.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new LineChart( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### LineChart.prototype.render() - -Renders a line chart sparkline. - -```javascript -var chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.render(); -// returns '⡈⠑⠢⠔⠒⠒⠒' -``` - - - -#### LineChart.prototype.toString() - -Serializes a line chart sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); - -var str = chart.toString(); -// returns '⡈⠑⠢⠔⠒⠒⠒' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new LineChart(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new LineChart(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var lineChart = require( '@stdlib/plot/sparklines/unicode/line' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a new line chart: -chart = lineChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu()*100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline-line [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline-line --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline-line --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline-line 1 2 3 4 5 6 -⡠⠤⠔⠒⠊⠉ -``` - -```bash -$ echo -n $'1\n2\n3\n4\n5\n6\n' | sparkline-line --ymax 3 -⡐⠊⠉⠉⠉⠉ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/line/benchmark/benchmark.js b/sparklines/unicode/line/benchmark/benchmark.js deleted file mode 100644 index 3257d1b..0000000 --- a/sparklines/unicode/line/benchmark/benchmark.js +++ /dev/null @@ -1,365 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var LineChart = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new LineChart(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = LineChart; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new LineChart( opts ); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new LineChart( [ 1, 2, 3 ] ); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'infinities': true, - 'isDefined': noop, - 'yMax': 0, - 'yMin': 4 - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new LineChart( [ 1, 2, 3 ], opts ); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof LineChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:infinities', function benchmark( b ) { - var bool; - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.infinities = !bool; - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.infinities !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMax', function benchmark( b ) { - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMax = i; - if ( v.yMax !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMax !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:yMin', function benchmark( b ) { - var v; - var i; - - v = new LineChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.yMin = i; - if ( v.yMin !== i ) { - b.fail( 'unexpected value' ); - } - } - b.toc(); - if ( v.yMin !== i-1 ) { - b.fail( 'unexpected value' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/line/benchmark/benchmark.render.js b/sparklines/unicode/line/benchmark/benchmark.render.js deleted file mode 100644 index 46dc56b..0000000 --- a/sparklines/unicode/line/benchmark/benchmark.render.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var LineChart = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {LineChart} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = randu(); - } - chart.data = x; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( randu() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new LineChart({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:len='+len, f ); - - chart = new LineChart({ - 'bufferSize': len, - 'yMin': 0.0, - 'yMax': 1.0 - }); - f = createBenchmark( len, chart ); - bench( pkg+'::ymin,ymax:render:len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/line/bin/cli b/sparklines/unicode/line/bin/cli deleted file mode 100755 index e3f1cc2..0000000 --- a/sparklines/unicode/line/bin/cli +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - // Get any provided command-line flags: - if ( flags.ymin ) { - opts.yMin = parseFloat( flags.ymin ); - } - if ( flags.ymax ) { - opts.yMax = parseFloat( flags.ymax ); - } - if ( flags.infinities ) { - opts.infinities = flags.infinities; - } - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/line/docs/repl.txt b/sparklines/unicode/line/docs/repl.txt deleted file mode 100644 index 53665cd..0000000 --- a/sparklines/unicode/line/docs/repl.txt +++ /dev/null @@ -1,95 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a sparkline line chart instance. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.infinities: boolean (optional) - Boolean indicating whether to encode infinite values. Default: false. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - options.yMax: number|null (optional) - Maximum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - options.yMin: number|null (optional) - Minimum value of the y-axis domain. If `null`, the value is computed - from the data. Default: null. - - Returns - ------- - chart: LineChart - Line chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.infinities - Indicates whether to encode infinite values. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - chart.render() - Renders a line chart sparkline. - - chart.yMax - Maximum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - chart.yMin - Minimum value of the y-axis domain. If set to `null`, when accessed, the - returned value is computed from the data. - - Examples - -------- - > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '⡈⠑⠢⠔⠒⠒⠒' - - See Also - -------- - diff --git a/sparklines/unicode/line/docs/usage.txt b/sparklines/unicode/line/docs/usage.txt deleted file mode 100644 index 5c3ea9f..0000000 --- a/sparklines/unicode/line/docs/usage.txt +++ /dev/null @@ -1,11 +0,0 @@ - -Usage: sparkline-line [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. - --ymin min Minimum value of y-axis domain. - --ymax max Maximum value of y-axis domain. - --infinities Encode infinite values. diff --git a/sparklines/unicode/line/etc/cli_opts.json b/sparklines/unicode/line/etc/cli_opts.json deleted file mode 100644 index d11e5f6..0000000 --- a/sparklines/unicode/line/etc/cli_opts.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - "split", - "ymin", - "ymax" - ], - "boolean": [ - "help", - "version", - "infinities" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/line/examples/index.js b/sparklines/unicode/line/examples/index.js deleted file mode 100644 index 968d2cc..0000000 --- a/sparklines/unicode/line/examples/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var lineChart = require( './../lib' ); - -var chart; -var data; -var opts; -var str; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Set chart options: -opts = { - 'infinities': true -}; - -// Create a new line chart: -chart = lineChart( data, opts ); - -// Render the chart as a string: -str = chart.render(); - -console.log( str ); -// => '...' diff --git a/sparklines/unicode/line/examples/update.js b/sparklines/unicode/line/examples/update.js deleted file mode 100644 index 38b26f7..0000000 --- a/sparklines/unicode/line/examples/update.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var lineChart = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -// Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = randu() * 100.0; -} - -// Create a new line chart: -chart = lineChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; -chart.yMin = 0.0; -chart.yMax = 100.0; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( randu() * 100.0 ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/line/lib/defaults.js b/sparklines/unicode/line/lib/defaults.js deleted file mode 100644 index 7a94618..0000000 --- a/sparklines/unicode/line/lib/defaults.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 default options. -* -* @private -* @returns {Object} default options -*/ -function defaults() { - var out = {}; - - // Boolean indicating whether to encode infinite values: - out.infinities = false; - - // Maximum value of the y-axis domain: - out.yMax = null; - - // Minimum value of the y-axis domain: - out.yMin = null; - - return out; -} - - -// EXPORTS // - -module.exports = defaults; diff --git a/sparklines/unicode/line/lib/index.js b/sparklines/unicode/line/lib/index.js deleted file mode 100644 index b4f0c65..0000000 --- a/sparklines/unicode/line/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline line chart. -* -* @module @stdlib/plot/sparklines/unicode/line -* -* @example -* var lineChart = require( '@stdlib/plot/sparklines/unicode/line' ); -* -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = lineChart( data ); -* -* var str = chart.render(); -* // returns '⡈⠑⠢⠔⠒⠒⠒' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/line/lib/main.js b/sparklines/unicode/line/lib/main.js deleted file mode 100644 index 1a56c90..0000000 --- a/sparklines/unicode/line/lib/main.js +++ /dev/null @@ -1,266 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var isCollection = require( '@stdlib/assert/is-collection' ); -var mergeFcn = require( '@stdlib/utils/merge' ).factory; -var pick = require( '@stdlib/utils/pick' ); -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../../sparklines/base/ctor' ); -var defaults = require( './defaults.js' ); -var setInfinities = require( './props/infinities/set.js' ); -var getInfinities = require( './props/infinities/get.js' ); -var setYMax = require( './props/y-max/set.js' ); -var getYMax = require( './props/y-max/get.js' ); -var setYMin = require( './props/y-min/set.js' ); -var getYMin = require( './props/y-min/get.js' ); -var render = require( './render.js' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:line-chart:unicode:main' ); - -var merge = mergeFcn({ - 'extend': false -}); - -// List of private properties (note: keep in alphabetical order): -var PRIVATE_PROPS = [ - '_infinities', - '_yMax', - '_yMin' -]; - -// List of options properties (note: keep in alphabetical order): -var OPTIONS_PROPS = [ - 'infinities', - 'yMax', - 'yMin' -]; - - -// MAIN // - -/** -* Unicode sparkline line chart constructor. -* -* @constructor -* @param {(Collection|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(Collection|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {boolean} [options.infinities=false] - boolean indicating whether to encode infinite values -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @param {(FiniteNumber|null)} [options.yMax] - maximum value of the y-axis domain -* @param {(FiniteNumber|null)} [options.yMin] - minimum value of the y-axis domain -* @throws {TypeError} must provide valid options -* @returns {LineChart} chart instance -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new LineChart( data ); -* -* var str = chart.render(); -* // returns '⡈⠑⠢⠔⠒⠒⠒' -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* var opts = { -* 'data': data -* }; -* var chart = new LineChart( opts ); -* -* var str = chart.render(); -* // returns '⡈⠑⠢⠔⠒⠒⠒' -*/ -function LineChart() { - var options; - var nargs; - var opts; - var keys; - var key; - var i; - - nargs = arguments.length; - if ( !(this instanceof LineChart) ) { - if ( nargs === 0 ) { - return new LineChart(); - } - if ( nargs === 1 ) { - return new LineChart( arguments[ 0 ] ); - } - return new LineChart( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - // Extract chart-specific options... - opts = defaults(); - if ( nargs === 1 && !isCollection( arguments[ 0 ] ) ) { - options = arguments[ 0 ]; - } else if ( nargs === 2 ) { - options = arguments[ 1 ]; - } else { - options = {}; - } - opts = merge( opts, pick( options, OPTIONS_PROPS ) ); - - debug( 'Creating an instance with the following configuration: %s.', JSON.stringify( options ) ); - - // Initialize private chart-specific properties... - for ( i = 0; i < PRIVATE_PROPS.length; i++ ) { - defineProperty( this, PRIVATE_PROPS[i], { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': null - }); - } - - // Set chart-specific properties... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - this[ key ] = opts[ key ]; - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( LineChart, Sparkline ); - -/** -* Boolean indicating whether to encode infinite values. -* -* @name infinities -* @memberof LineChart.prototype -* @type {boolean} -* @throws {TypeError} must be a boolean -* @default false -* -* @example -* var chart = new LineChart(); -* chart.infinities = true; -* -* @example -* var chart = new LineChart({ -* 'infinities': true -* }); -* var bool = chart.infinities; -* // returns true -*/ -defineProperty( LineChart.prototype, 'infinities', { - 'configurable': false, - 'enumerable': true, - 'set': setInfinities, - 'get': getInfinities -}); - -/** -* Maximum value of the y-axis domain. -* -* @name yMax -* @memberof LineChart.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new LineChart(); -* chart.yMax = 100.0; -* -* @example -* var chart = new LineChart({ -* 'yMax': 314.0 -* }); -* var ymax = chart.yMax; -* // returns 314.0 -*/ -defineProperty( LineChart.prototype, 'yMax', { - 'configurable': false, - 'enumerable': true, - 'set': setYMax, - 'get': getYMax -}); - -/** -* Minimum value of the y-axis domain. -* -* @name yMin -* @memberof LineChart.prototype -* @type {(FiniteNumber|null)} -* @throws {TypeError} must be a finite number or null -* -* @example -* var chart = new LineChart(); -* chart.yMin = -100.0; -* -* @example -* var chart = new LineChart({ -* 'yMin': 3.14 -* }); -* var ymin = chart.yMin; -* // returns 3.14 -*/ -defineProperty( LineChart.prototype, 'yMin', { - 'configurable': false, - 'enumerable': true, - 'set': setYMin, - 'get': getYMin -}); - -/** -* Renders a sparkline line chart. -* -* @private -* @name _render -* @memberof LineChart.prototype -* @type {Function} -* @returns {string} rendered sparkline line chart -* -* @example -* var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; -* -* var chart = new LineChart( data ); -* -* var str = chart.render(); -* // returns '⡈⠑⠢⠔⠒⠒⠒' -*/ -LineChart.prototype._render = render; // eslint-disable-line no-underscore-dangle - - -// EXPORTS // - -module.exports = LineChart; diff --git a/sparklines/unicode/line/lib/props/infinities/get.js b/sparklines/unicode/line/lib/props/infinities/get.js deleted file mode 100644 index 15be814..0000000 --- a/sparklines/unicode/line/lib/props/infinities/get.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns a flag indicating whether to encode infinite values. -* -* @private -* @returns {boolean} boolean indicating whether to encode infinite values -*/ -function get() { - /* eslint-disable no-invalid-this */ - return this._infinities; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/line/lib/props/infinities/set.js b/sparklines/unicode/line/lib/props/infinities/set.js deleted file mode 100644 index b439b98..0000000 --- a/sparklines/unicode/line/lib/props/infinities/set.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:line-chart:unicode:set:infinities' ); - - -// MAIN // - -/** -* Sets a flag indicating whether to encode infinite values. -* -* @private -* @param {boolean} bool - boolean flag -* @throws {TypeError} must be a boolean -*/ -function set( bool ) { - /* eslint-disable no-invalid-this */ - if ( !isBoolean( bool ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', 'infinities', bool ) ); - } - if ( bool !== this._infinities ) { - debug( 'Current value: %s.', this._infinities ); - - this._infinities = bool; - debug( 'New value: %s.', this._infinities ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/line/lib/props/y-max/get.js b/sparklines/unicode/line/lib/props/y-max/get.js deleted file mode 100644 index 8f722bf..0000000 --- a/sparklines/unicode/line/lib/props/y-max/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the maximum value of the y-axis domain. -* -* @private -* @returns {(FiniteNumber|null)} maximum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var max; - var len; - var d; - var i; - - if ( this._yMax === null ) { - len = this._data.length; - max = NINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== PINF && d > max ) { - max = d; - } - } - return max; - } - return this._yMax; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/line/lib/props/y-max/set.js b/sparklines/unicode/line/lib/props/y-max/set.js deleted file mode 100644 index 439c194..0000000 --- a/sparklines/unicode/line/lib/props/y-max/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:line-chart:unicode:set:y-max' ); - - -// MAIN // - -/** -* Sets the maximum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} max - maximum value -* @throws {TypeError} must be a finite number or null -*/ -function set( max ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( max ) && !isNull( max ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMax', max ) ); - } - if ( max !== this._yMax ) { - debug( 'Current value: %s.', this._yMax ); - - this._yMax = max; - debug( 'New value: %s.', this._yMax ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/line/lib/props/y-min/get.js b/sparklines/unicode/line/lib/props/y-min/get.js deleted file mode 100644 index b084808..0000000 --- a/sparklines/unicode/line/lib/props/y-min/get.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// MAIN // - -/** -* Returns the minimum value of the y-axis domain. -* -* @private -* @returns {number} minimum value of the y-axis domain -*/ -function get() { - /* eslint-disable no-invalid-this */ - var min; - var len; - var d; - var i; - - if ( this._yMin === null ) { - len = this._data.length; - min = PINF; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._isDefined( d ) && d !== NINF && d < min ) { - min = d; - } - } - return min; - } - return this._yMin; -} - - -// EXPORTS // - -module.exports = get; diff --git a/sparklines/unicode/line/lib/props/y-min/set.js b/sparklines/unicode/line/lib/props/y-min/set.js deleted file mode 100644 index eb86c24..0000000 --- a/sparklines/unicode/line/lib/props/y-min/set.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 logger = require( 'debug' ); -var isFiniteNumber = require( '@stdlib/assert/is-finite' ).isPrimitive; -var isNull = require( '@stdlib/assert/is-null' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var debug = logger( 'sparkline:line-chart:unicode:set:y-min' ); - - -// MAIN // - -/** -* Sets the minimum value of the y-axis domain. -* -* @private -* @param {(FiniteNumber|null)} min - minimum value -* @throws {TypeError} must be a finite number or null -*/ -function set( min ) { - /* eslint-disable no-invalid-this */ - if ( !isFiniteNumber( min ) && !isNull( min ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a finite number or null. Value: `%s`.', 'yMin', min ) ); - } - if ( min !== this._yMin ) { - debug( 'Current value: %s.', this._yMin ); - - this._yMin = min; - debug( 'New value: %s.', this._yMin ); - - this.emit( 'change' ); - } -} - - -// EXPORTS // - -module.exports = set; diff --git a/sparklines/unicode/line/lib/render.js b/sparklines/unicode/line/lib/render.js deleted file mode 100644 index dd3a617..0000000 --- a/sparklines/unicode/line/lib/render.js +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 abs = require( '@stdlib/math/base/special/abs' ); -var round = require( '@stdlib/math/base/special/round' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); - - -// VARIABLES // - -// See [Braille Patterns]{@link https://en.wikipedia.org/wiki/Braille_Patterns}. -var UNICODE_BRAILLE_ELEMENTS = [ - [ '⣀', '⡠', '⡐', '⡈' ], // U+28C0, U+2860, U+2850, U+2848 - [ '⢄', '⠤', '⠔', '⠌' ], // U+2884, U+2824, U+2814, U+2802 - [ '⢂', '⠢', '⠒', '⠊' ], // U+2882, U+2822, U+2812, U+280A - [ '⢁', '⠡', '⠑', '⠉' ] // U+2881, U+2821, U+2811, U+2809 -]; -var UNICODE_INF = '∞'; // U+221E -var MISSING_VALUE = ' '; - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var glyphs; - var range; - var str; - var min; - var max; - var len; - var idx; - var FLG; - var d; - var v; - var n; - var i; - var j; - - len = this._data.length; - if ( len === 0 ) { - return ''; - } - min = this.yMin; - max = this.yMax; - range = abs( max-min ); - - // Check if data is constant... - if ( range === 0.0 ) { - // If `max` is `0`, encode each finite datum as the lowest Braille glyph... - if ( max === 0.0 ) { - glyphs = [ [ UNICODE_BRAILLE_ELEMENTS[0][0] ] ]; - } - // Otherwise, encode each finite datum as a mid-sized Braille glyph... - else { - glyphs = [ [ UNICODE_BRAILLE_ELEMENTS[2][2] ] ]; - } - } else { - glyphs = UNICODE_BRAILLE_ELEMENTS; - } - // Assign each datum to a bin... - idx = new Array( len ); - FLG = new Array( len ); - n = glyphs.length - 1; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( !this._isDefined( d, i ) || d === PINF || d === NINF ) { - FLG[ i ] = true; - continue; - } - // Normalize the datum (aka feature scaling): - if ( range ) { - v = ( d-min ) / range; - } else { - v = 0.0; - } - // Determine the bin index: - j = round( v*n ); - if ( j < 0 ) { - j = 0; - } else if ( j > n ) { - j = n; - } - idx[ i ] = j; - } - - // TODO: color encoding: one color for both pos and neg or two colors for separate colors - // TODO: negative values diff color (red) - - // For each datum, we peek ahead to determine if the next value is greater than or less than the current value. The magnitude of the difference determines the glyph slope. - str = ''; - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( this._infinities && ( d === PINF || d === NINF ) ) { - str += UNICODE_INF; - continue; - } - if ( FLG[ i ] ) { - str += MISSING_VALUE; - continue; - } - if ( i === len-1 ) { - // The final glyph is flat, as the next value is unknown... - j = idx[ i ]; - str += glyphs[ j ][ j ]; - break; - } - j = i + 1; - n = this._data[ j ]; - if ( n === PINF ) { - j = 3; // highest bin - } else if ( n === NINF ) { - j = 0; // lowest bin - } else if ( FLG[ j ] ) { - j = idx[ i ]; // same bin, as no slope can be inferred from a missing value - } else { - j = idx[ j ]; // slope toward the next value's bin - } - str += glyphs[ idx[i] ][ j ]; - } - return str; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/line/package.json b/sparklines/unicode/line/package.json deleted file mode 100644 index 962b609..0000000 --- a/sparklines/unicode/line/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode/line", - "version": "0.0.0", - "description": "Create a Unicode sparkline line chart.", - "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" - } - ], - "bin": { - "sparkline-line": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "line", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode", - "trend" - ] -} diff --git a/sparklines/unicode/line/test/fixtures/stdin_error.js.txt b/sparklines/unicode/line/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/line/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/line/test/test.auto_render.js b/sparklines/unicode/line/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/line/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/line/test/test.buffer_size.js b/sparklines/unicode/line/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/line/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.cli.js b/sparklines/unicode/line/test/test.cli.js deleted file mode 100644 index 14a2d36..0000000 --- a/sparklines/unicode/line/test/test.cli.js +++ /dev/null @@ -1,363 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders a line chart', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠤⠔⠒⠊⠉\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the minimum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymin=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⣀⣀⡠⠔⠊⠉\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the maximum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymax=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡐⠊⠉⠉⠉⠉\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠔⠒⠊⠉∞\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities (disable)', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--no-infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠔⠒⠊⠉ \n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf "1\n2\n3\n4\n5\n6"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠤⠔⠒⠊⠉\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠤⠔⠒⠊⠉\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠤⠔⠒⠊⠉\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/line/test/test.data.js b/sparklines/unicode/line/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/line/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/line/test/test.description.js b/sparklines/unicode/line/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/line/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.infinities.js b/sparklines/unicode/line/test/test.infinities.js deleted file mode 100644 index db3e916..0000000 --- a/sparklines/unicode/line/test/test.infinities.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `infinities` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.infinities = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - chart.infinities = true; - t.strictEqual( chart.infinities, true, 'returns expected value' ); - - chart.infinities = false; - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.is_defined.js b/sparklines/unicode/line/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/line/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.js b/sparklines/unicode/line/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/line/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/line/test/test.label.js b/sparklines/unicode/line/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/line/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.main.js b/sparklines/unicode/line/test/test.main.js deleted file mode 100644 index 4c62b34..0000000 --- a/sparklines/unicode/line/test/test.main.js +++ /dev/null @@ -1,572 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var LineChart = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof LineChart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new LineChart(); - t.strictEqual( chart instanceof LineChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = LineChart; - chart = ctor(); - - t.strictEqual( chart instanceof LineChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = LineChart; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof LineChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = LineChart; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof LineChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = LineChart; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof LineChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new LineChart( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new LineChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new LineChart({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new LineChart( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new LineChart({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new LineChart( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new LineChart( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new LineChart( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new LineChart( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `infinities` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.infinities, false, 'default value is false' ); - - opts = { - 'infinities': true - }; - chart = new LineChart( opts ); - - expected = true; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - chart.infinities = false; - - expected = false; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new LineChart( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new LineChart( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMax` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.yMax, NINF, 'default value is -infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMax': 10 - }; - chart = new LineChart( opts ); - - expected = 10; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - chart.yMax = null; - - expected = 3; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMin` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new LineChart(); - t.strictEqual( chart.yMin, PINF, 'default value is +infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMin': 10 - }; - chart = new LineChart( opts ); - - expected = 10; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - chart.yMin = null; - - expected = 1; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new LineChart(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '⡈⠑⠢⠔⠒⠒⠒', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'by default, a chart renders `NaN` and infinite values as missing values', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ - 1.0, - 5.0, - NaN, - PINF, - NINF, - 4.0, - 3.0 - ]; - - str = chart.render(); - t.strictEqual( str, '⡈⠉ ⠒⠒', 'returns rendered chart with missing values' ); - - t.end(); -}); - -tape( 'if the `infinities` option/property is set to `true`, the chart encodes infinite values as `∞`', function test( t ) { - var chart; - var str; - - chart = new LineChart({ - 'infinities': true - }); - chart.data = [ - 1.0, - 5.0, - NaN, - PINF, - NINF, - 4.0, - 3.0 - ]; - - str = chart.render(); - t.strictEqual( str, '⡈⠉ ∞∞⠒⠒', 'returns rendered chart with infinities encoded as ∞' ); - - t.end(); -}); - -tape( 'if provided `yMin` and/or `yMax` values, the chart fixes the y-axis domain', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ - -1.0, - 5.0, - -3.0, - 2.0, - -4.0, - 4.0, - 3.0 - ]; - chart.yMin = 0.0; - chart.yMax = 10.0; - - str = chart.render(); - t.strictEqual( str, '⡐⢂⡠⢄⡠⠤⠤', 'returns rendered chart with fixed y-axis domain' ); - - chart.data = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; - chart.yMin = null; - chart.yMax = 3.0; - - str = chart.render(); - t.strictEqual( str, '⡐⠊⠉⠉⠉⠉', 'returns rendered chart with fixed y-axis domain' ); - - t.end(); -}); - -tape( 'if all datum are `0` and the y-axis domain is `0`, the chart renders each finite datum as the smallest glyph', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]; - - str = chart.render(); - t.strictEqual( str, '⣀⣀⣀⣀⣀⣀⣀', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if all datum are constant and non-zero and the y-axis domain is `0`, the chart renders each finite datum as the same mid-sized glyph', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ - 5.0, - 5.0, - 5.0, - 5.0, - 5.0, - 5.0, - 5.0 - ]; - - str = chart.render(); - t.strictEqual( str, '⠒⠒⠒⠒⠒⠒⠒', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'glyphs preceding infinite values slope in the direction of those values', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ 1.0, 5.0, NINF, 2.0, PINF, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '⡈⢁ ⠌ ⠒⠒', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new LineChart(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.toString(); - t.strictEqual( str, '⡈⠑⠢⠔⠒⠒⠒', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/line/test/test.push.js b/sparklines/unicode/line/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/line/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/line/test/test.y_max.js b/sparklines/unicode/line/test/test.y_max.js deleted file mode 100644 index ca96a99..0000000 --- a/sparklines/unicode/line/test/test.y_max.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMax` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMax = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMax': 10.0 - }); - t.strictEqual( chart.yMax, 10.0, 'returns expected value' ); - - chart.yMax = 20.0; - t.strictEqual( chart.yMax, 20.0, 'returns expected value' ); - - chart.yMax = 30.0; - t.strictEqual( chart.yMax, 30.0, 'returns expected value' ); - - chart.yMax = null; - t.strictEqual( chart.yMax, 3, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMax` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMax` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/line/test/test.y_min.js b/sparklines/unicode/line/test/test.y_min.js deleted file mode 100644 index 470d9a7..0000000 --- a/sparklines/unicode/line/test/test.y_min.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMin` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMin = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMin': 10.0 - }); - t.strictEqual( chart.yMin, 10.0, 'returns expected value' ); - - chart.yMin = 20.0; - t.strictEqual( chart.yMin, 20.0, 'returns expected value' ); - - chart.yMin = 30.0; - t.strictEqual( chart.yMin, 30.0, 'returns expected value' ); - - chart.yMin = null; - t.strictEqual( chart.yMin, 1, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMin` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMin` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/package.json b/sparklines/unicode/package.json deleted file mode 100644 index 6d6ff29..0000000 --- a/sparklines/unicode/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode", - "version": "0.0.0", - "description": "Create a Unicode sparkline.", - "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" - } - ], - "bin": { - "sparkline": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "column", - "bar", - "histogram", - "hist", - "win", - "loss", - "tristate", - "up", - "down", - "line", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode" - ] -} diff --git a/sparklines/unicode/test/fixtures/stdin_error.js.txt b/sparklines/unicode/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/test/test.auto_render.js b/sparklines/unicode/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/test/test.buffer_size.js b/sparklines/unicode/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.cli.js b/sparklines/unicode/test/test.cli.js deleted file mode 100644 index afde671..0000000 --- a/sparklines/unicode/test/test.cli.js +++ /dev/null @@ -1,387 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders a Unicode sparkline', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying a chart type', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--type=line\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '⡠⠤⠔⠒⠊⠉\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the minimum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymin=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▁▁▃▆█\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports specifying the maximum value of the y-axis domain', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'6\'; process.argv[ 8 ] = \'--ymax=3\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▅████\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▃▅▆█∞\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports encoding infinities (disable)', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'1\'; process.argv[ 3 ] = \'2\'; process.argv[ 4 ] = \'3\'; process.argv[ 5 ] = \'4\'; process.argv[ 6 ] = \'5\'; process.argv[ 7 ] = \'9e500\'; process.argv[ 8 ] = \'--no-infinities\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▃▅▆█ \n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf "1\n2\n3\n4\n5\n6"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf "1\t2\t3\t4\t5\t6"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▁▂▄▅▇█\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/test/test.data.js b/sparklines/unicode/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/test/test.description.js b/sparklines/unicode/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.infinities.js b/sparklines/unicode/test/test.infinities.js deleted file mode 100644 index db3e916..0000000 --- a/sparklines/unicode/test/test.infinities.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `infinities` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.infinities = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - chart.infinities = true; - t.strictEqual( chart.infinities, true, 'returns expected value' ); - - chart.infinities = false; - t.strictEqual( chart.infinities, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': false - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `infinities` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'infinities': true - }); - - chart.on( 'change', onChange ); - chart.infinities = true; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.is_defined.js b/sparklines/unicode/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.js b/sparklines/unicode/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/test/test.label.js b/sparklines/unicode/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.main.js b/sparklines/unicode/test/test.main.js deleted file mode 100644 index 4aa7014..0000000 --- a/sparklines/unicode/test/test.main.js +++ /dev/null @@ -1,600 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var UnicodeSparkline = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof UnicodeSparkline, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new UnicodeSparkline(); - t.strictEqual( chart instanceof UnicodeSparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = UnicodeSparkline; - chart = ctor(); - - t.strictEqual( chart instanceof UnicodeSparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = UnicodeSparkline; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof UnicodeSparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = UnicodeSparkline; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo', - 'type': 'line', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof UnicodeSparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = UnicodeSparkline; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'infinities': true, - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo', - 'type': 'line', - 'yMin': null, - 'yMax': null - }); - - t.strictEqual( chart instanceof UnicodeSparkline, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new UnicodeSparkline( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new UnicodeSparkline( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UnicodeSparkline({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UnicodeSparkline( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UnicodeSparkline({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UnicodeSparkline( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new UnicodeSparkline( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new UnicodeSparkline( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new UnicodeSparkline( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `infinities` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.infinities, false, 'default value is false' ); - - opts = { - 'infinities': true - }; - chart = new UnicodeSparkline( opts ); - - expected = true; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - chart.infinities = false; - - expected = false; - t.strictEqual( chart.infinities, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new UnicodeSparkline( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new UnicodeSparkline( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `type` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.type, 'column', 'default value is a column chart' ); - - opts = { - 'type': 'line' - }; - chart = new UnicodeSparkline( opts ); - - expected = 'line'; - t.strictEqual( chart.type, expected, 'returns expected value' ); - - chart.type = 'win-loss'; - - expected = 'win-loss'; - t.strictEqual( chart.type, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMax` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.yMax, NINF, 'default value is -infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMax': 10 - }; - chart = new UnicodeSparkline( opts ); - - expected = 10; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - chart.yMax = null; - - expected = 3; - t.strictEqual( chart.yMax, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `yMin` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UnicodeSparkline(); - t.strictEqual( chart.yMin, PINF, 'default value is +infinity' ); - - opts = { - 'data': [ 1, 2, 3 ], - 'yMin': 10 - }; - chart = new UnicodeSparkline( opts ); - - expected = 10; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - chart.yMin = null; - - expected = 1; - t.strictEqual( chart.yMin, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new UnicodeSparkline(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance supports rendering a column chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'column' - }); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance supports rendering a line chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'line' - }); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.render(); - t.strictEqual( str, '⡈⠑⠢⠔⠒⠒⠒', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance supports rendering a tristate chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'tristate' - }); - chart.data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '▄▀──▀▄▄▀', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance supports rendering an up/down chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'up-down' - }); - chart.data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '↓↑↑↑↑↓↓↑', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'an instance supports rendering a win/loss chart', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'win-loss' - }); - chart.data = [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2, 2, 2, -2 ]; - - str = chart.render(); - t.strictEqual( str, '┌╵└┴╵╷╷╵┌┬┴┴┬', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'for certain chart types, if the `infinities` option/property is set to `true`, the chart encodes infinite values as `∞`', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'column', - 'infinities': true - }); - chart.data = [ - 1.0, - 5.0, - NaN, - PINF, - NINF, - 4.0, - 3.0 - ]; - - str = chart.render(); - t.strictEqual( str, '▁█ ∞∞▆▅', 'returns rendered chart with infinities encoded as ∞' ); - - t.end(); -}); - -tape( 'for certain chart types, if provided `yMin` and/or `yMax` values, the chart fixes the y-axis domain', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline({ - 'type': 'column' - }); - chart.data = [ - -1.0, - 5.0, - -3.0, - 2.0, - -4.0, - 4.0, - 3.0 - ]; - chart.yMin = 0.0; - chart.yMax = 10.0; - - str = chart.render(); - t.strictEqual( str, '▁▅▁▂▁▄▃', 'returns rendered chart with fixed y-axis domain' ); - - chart.data = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; - chart.yMin = null; - chart.yMax = 3.0; - - str = chart.render(); - t.strictEqual( str, '▁▅████', 'returns rendered chart with fixed y-axis domain' ); - - t.end(); -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new UnicodeSparkline(); - chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ]; - - str = chart.toString(); - t.strictEqual( str, '▁█▅▃▆▆▅', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/test/test.push.js b/sparklines/unicode/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/test/test.type.js b/sparklines/unicode/test/test.type.js deleted file mode 100644 index f3f62bf..0000000 --- a/sparklines/unicode/test/test.type.js +++ /dev/null @@ -1,117 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `type` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 'COLUMN', - 'WIN/LOSS', - 'win/loss', - 'up/down', - 'Line', - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.type = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'type': 'win-loss' - }); - t.strictEqual( chart.type, 'win-loss', 'returns expected value' ); - - chart.type = 'line'; - t.strictEqual( chart.type, 'line', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `type` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'type': 'column' - }); - - chart.on( 'change', onChange ); - chart.type = 'line'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `type` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'type': 'line' - }); - - chart.on( 'change', onChange ); - chart.type = 'line'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.y_max.js b/sparklines/unicode/test/test.y_max.js deleted file mode 100644 index ca96a99..0000000 --- a/sparklines/unicode/test/test.y_max.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMax` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMax = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMax': 10.0 - }); - t.strictEqual( chart.yMax, 10.0, 'returns expected value' ); - - chart.yMax = 20.0; - t.strictEqual( chart.yMax, 20.0, 'returns expected value' ); - - chart.yMax = 30.0; - t.strictEqual( chart.yMax, 30.0, 'returns expected value' ); - - chart.yMax = null; - t.strictEqual( chart.yMax, 3, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMax` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMax` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMax': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMax = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/test/test.y_min.js b/sparklines/unicode/test/test.y_min.js deleted file mode 100644 index 470d9a7..0000000 --- a/sparklines/unicode/test/test.y_min.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `yMin` value', function test( t ) { - var values; - var i; - - values = [ - '5', - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.yMin = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ], - 'yMin': 10.0 - }); - t.strictEqual( chart.yMin, 10.0, 'returns expected value' ); - - chart.yMin = 20.0; - t.strictEqual( chart.yMin, 20.0, 'returns expected value' ); - - chart.yMin = 30.0; - t.strictEqual( chart.yMin, 30.0, 'returns expected value' ); - - chart.yMin = null; - t.strictEqual( chart.yMin, 1, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `yMin` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 30.0; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `yMin` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'yMin': 10.0 - }); - - chart.on( 'change', onChange ); - chart.yMin = 10.0; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/tristate/README.md b/sparklines/unicode/tristate/README.md deleted file mode 100644 index e7a0185..0000000 --- a/sparklines/unicode/tristate/README.md +++ /dev/null @@ -1,463 +0,0 @@ - - -# Tristate Chart - -> Create a Unicode sparkline tristate chart. - -
- -## Usage - -```javascript -var TristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); -``` - -#### TristateChart( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new TristateChart(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. - -* * * - -### Writable Properties - - - -#### TristateChart.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new TristateChart(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### TristateChart.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new TristateChart(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### TristateChart.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Int8Array = require( '@stdlib/array/int8' ); - -var chart = new TristateChart(); - -// Set: -chart.data = new Int8Array( [ 1, 0, -1, 1, 1, 0 ] ); - -// Get: -var data = chart.data; -// returns [ 1, 0, -1, 1, 1, 0 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### TristateChart.prototype.description - -Chart description. - -```javascript -var chart = new TristateChart(); - -// Set: -chart.description = 'Gains and losses for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Gains and losses for the past 30 days.' -``` - - - -#### TristateChart.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - return ( d !== null ); -} - -var chart = new TristateChart(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is to ignore values which are `NaN`. - - - -#### TristateChart.prototype.label - -Data label. - -```javascript -var chart = new TristateChart(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - -* * * - -### Methods - - - -#### TristateChart.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new TristateChart( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### TristateChart.prototype.render() - -Renders a tristate chart sparkline. - -```javascript -var chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); - -var str = chart.render(); -// returns '▄▀──▀▄▄▀' -``` - -In a tristate chart, negative values are encoded as lower blocks, positive values are encoded as upper blocks, and values equal to zero are encoded as middle lines. - - - -#### TristateChart.prototype.toString() - -Serializes a tristate chart sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); - -var str = chart.toString(); -// returns '▄▀──▀▄▄▀' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new TristateChart(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new TristateChart(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var tristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); - -var chart; -var data; -var id; -var i; - -function datum() { - var d = randu(); - if ( d > 0.67 ) { - return 1; - } - if ( d < 0.33 ) { - return -1; - } - return 0; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new tristate chart: -chart = tristateChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline-tristate [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline-tristate --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline-tristate --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline-tristate -- -1 1 0 0 1 -1 -1 1 -▄▀──▀▄▄▀ -``` - -```bash -$ echo -n $'-1\n1\n0\n0\n1\n-1\n-1\n1\n' | sparkline-tristate -▄▀──▀▄▄▀ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/tristate/benchmark/benchmark.js b/sparklines/unicode/tristate/benchmark/benchmark.js deleted file mode 100644 index ad80d7d..0000000 --- a/sparklines/unicode/tristate/benchmark/benchmark.js +++ /dev/null @@ -1,295 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var TristateChart = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new TristateChart(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = TristateChart; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new TristateChart( opts ); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new TristateChart( [ 1, 2, 3 ] ); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new TristateChart( [ 1, 2, 3 ], opts ); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof TristateChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new TristateChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/tristate/benchmark/benchmark.render.js b/sparklines/unicode/tristate/benchmark/benchmark.render.js deleted file mode 100644 index a0d309d..0000000 --- a/sparklines/unicode/tristate/benchmark/benchmark.render.js +++ /dev/null @@ -1,116 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Int8Array = require( '@stdlib/array/int8' ); -var pkg = require( './../package.json' ).name; -var TristateChart = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {TristateChart} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var x; - var r; - var i; - - x = new Int8Array( len ); - for ( i = 0; i < x.length; i++ ) { - r = randu(); - if ( r > 0.51 ) { - x[ i ] = 1; - } else if ( r > 0.49 ) { - x[ i ] = 0; - } else { - x[ i ] = -1; - } - } - chart.data = x; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( randu() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new TristateChart({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/tristate/bin/cli b/sparklines/unicode/tristate/bin/cli deleted file mode 100755 index 3ea2f05..0000000 --- a/sparklines/unicode/tristate/bin/cli +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/tristate/docs/repl.txt b/sparklines/unicode/tristate/docs/repl.txt deleted file mode 100644 index 0d6ef0e..0000000 --- a/sparklines/unicode/tristate/docs/repl.txt +++ /dev/null @@ -1,77 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a sparkline tristate chart instance. - - In a tristate chart, negative values are encoded as lower blocks, positive - values are encoded as upper blocks, and values equal to zero are encoded as - middle lines. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - Returns - ------- - chart: TristateChart - Tristate chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore values which are `NaN`. - - chart.render() - Renders a tristate chart sparkline. - - Examples - -------- - > var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '▄▀──▀▄▄▀' - - See Also - -------- - diff --git a/sparklines/unicode/tristate/docs/usage.txt b/sparklines/unicode/tristate/docs/usage.txt deleted file mode 100644 index a7cebd4..0000000 --- a/sparklines/unicode/tristate/docs/usage.txt +++ /dev/null @@ -1,8 +0,0 @@ - -Usage: sparkline-tristate [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. diff --git a/sparklines/unicode/tristate/etc/cli_opts.json b/sparklines/unicode/tristate/etc/cli_opts.json deleted file mode 100644 index 7c40f9a..0000000 --- a/sparklines/unicode/tristate/etc/cli_opts.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "string": [ - "split" - ], - "boolean": [ - "help", - "version" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/tristate/examples/index.js b/sparklines/unicode/tristate/examples/index.js deleted file mode 100644 index 130c6e1..0000000 --- a/sparklines/unicode/tristate/examples/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var tristateChart = require( './../lib' ); - -var chart; -var data; -var str; -var d; -var i; - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - d = randu(); - if ( d > 0.67 ) { - d = 1; - } else if ( d < 0.33 ) { - d = -1; - } else { - d = 0; - } - data[ i ] = d; -} - -// Create a new tristate chart: -chart = tristateChart( data ); - -// Render the chart as a string: -str = chart.render(); - -console.log( str ); -// => '...' diff --git a/sparklines/unicode/tristate/examples/update.js b/sparklines/unicode/tristate/examples/update.js deleted file mode 100644 index bce364f..0000000 --- a/sparklines/unicode/tristate/examples/update.js +++ /dev/null @@ -1,81 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var tristateChart = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -function datum() { - var d = randu(); - if ( d > 0.67 ) { - return 1; - } - if ( d < 0.33 ) { - return -1; - } - return 0; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new tristate chart: -chart = tristateChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/tristate/lib/index.js b/sparklines/unicode/tristate/lib/index.js deleted file mode 100644 index 2f50c92..0000000 --- a/sparklines/unicode/tristate/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline tristate chart. -* -* @module @stdlib/plot/sparklines/unicode/tristate -* -* @example -* var tristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); -* -* var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; -* -* var chart = tristateChart( data ); -* -* var str = chart.render(); -* // returns '▄▀──▀▄▄▀' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/tristate/lib/main.js b/sparklines/unicode/tristate/lib/main.js deleted file mode 100644 index 94d4af8..0000000 --- a/sparklines/unicode/tristate/lib/main.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../../sparklines/base/ctor' ); - - -// MAIN // - -/** -* Unicode sparkline tristate chart constructor. -* -* @constructor -* @param {(ArrayLike|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(ArrayLikeObject|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @throws {TypeError} must provide valid options -* @returns {TristateChart} chart instance -* -* @example -* var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; -* -* var chart = new TristateChart( data ); -* -* var str = chart.render(); -* // returns '▄▀──▀▄▄▀' -* -* @example -* var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; -* var opts = { -* 'data': data -* }; -* var chart = new TristateChart( opts ); -* -* var str = chart.render(); -* // returns '▄▀──▀▄▄▀' -*/ -function TristateChart() { - var nargs; - - nargs = arguments.length; - if ( !(this instanceof TristateChart) ) { - if ( nargs === 0 ) { - return new TristateChart(); - } - if ( nargs === 1 ) { - return new TristateChart( arguments[ 0 ] ); - } - return new TristateChart( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( TristateChart, Sparkline ); - -/** -* Renders a sparkline tristate chart. -* -* @private -* @name _render -* @memberof TristateChart.prototype -* @type {Function} -* @returns {string} rendered sparkline tristate chart -* -* @example -* var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; -* -* var chart = new TristateChart( data ); -* -* var str = chart.render(); -* // returns '▄▀──▀▄▄▀' -*/ -TristateChart.prototype._render = require( './render.js' ); // eslint-disable-line no-underscore-dangle - - -// EXPORTS // - -module.exports = TristateChart; diff --git a/sparklines/unicode/tristate/lib/render.js b/sparklines/unicode/tristate/lib/render.js deleted file mode 100644 index bfc3bef..0000000 --- a/sparklines/unicode/tristate/lib/render.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// VARIABLES // - -// See [Block Elements]{@link https://en.wikipedia.org/wiki/Block_Elements}. -var UPPER_BLOCK = '▀'; // U+2580 -var LOWER_BLOCK = '▄'; // U+2584 - -var MIDDLE = '─'; // U+2500 -var MISSING_VALUE = ' '; - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var str; - var len; - var d; - var i; - - len = this._data.length; - if ( len === 0 ) { - return ''; - } - // Generate the sparkline chart, assigning a glyph to each datum... - str = ''; - - // TODO: color encoding: one color for both pos and neg or two colors for separate colors - - // TODO: "loss" values diff color (red) - - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( !this._isDefined( d, i ) ) { - str += MISSING_VALUE; - } else if ( d < 0.0 ) { - str += LOWER_BLOCK; - } else if ( d === 0.0 ) { - str += MIDDLE; - } else { - str += UPPER_BLOCK; - } - } - return str; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/tristate/package.json b/sparklines/unicode/tristate/package.json deleted file mode 100644 index 44db6c1..0000000 --- a/sparklines/unicode/tristate/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode/tristate", - "version": "0.0.0", - "description": "Create a Unicode sparkline tristate chart.", - "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" - } - ], - "bin": { - "sparkline-tristate": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "tristate", - "win", - "loss", - "draw", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode" - ] -} diff --git a/sparklines/unicode/tristate/test/fixtures/stdin_error.js.txt b/sparklines/unicode/tristate/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/tristate/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/tristate/test/test.auto_render.js b/sparklines/unicode/tristate/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/tristate/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/tristate/test/test.buffer_size.js b/sparklines/unicode/tristate/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/tristate/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/tristate/test/test.cli.js b/sparklines/unicode/tristate/test/test.cli.js deleted file mode 100644 index aafc40b..0000000 --- a/sparklines/unicode/tristate/test/test.cli.js +++ /dev/null @@ -1,267 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders a tristate chart', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'--\'; process.argv[ 3 ] = \'-1\'; process.argv[ 4 ] = \'1\'; process.argv[ 5 ] = \'0\'; process.argv[ 6 ] = \'0\'; process.argv[ 7 ] = \'1\'; process.argv[ 8 ] = \'-1\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▄▀──▀▄\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\n1\n0\n0\n1\n-1"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▄▀──▀▄\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\t1\t0\t0\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▄▀──▀▄\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\t1\t0\t0\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '▄▀──▀▄\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/tristate/test/test.data.js b/sparklines/unicode/tristate/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/tristate/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/tristate/test/test.description.js b/sparklines/unicode/tristate/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/tristate/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/tristate/test/test.is_defined.js b/sparklines/unicode/tristate/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/tristate/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/tristate/test/test.js b/sparklines/unicode/tristate/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/tristate/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/tristate/test/test.label.js b/sparklines/unicode/tristate/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/tristate/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/tristate/test/test.main.js b/sparklines/unicode/tristate/test/test.main.js deleted file mode 100644 index 242d859..0000000 --- a/sparklines/unicode/tristate/test/test.main.js +++ /dev/null @@ -1,374 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var TristateChart = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof TristateChart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new TristateChart(); - t.strictEqual( chart instanceof TristateChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = TristateChart; - chart = ctor(); - - t.strictEqual( chart instanceof TristateChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = TristateChart; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof TristateChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = TristateChart; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof TristateChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = TristateChart; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof TristateChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new TristateChart( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new TristateChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new TristateChart({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new TristateChart( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new TristateChart({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new TristateChart( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new TristateChart(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new TristateChart( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new TristateChart(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new TristateChart( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new TristateChart(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new TristateChart( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new TristateChart(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new TristateChart( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new TristateChart(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new TristateChart( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new TristateChart(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new TristateChart(); - chart.data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '▄▀──▀▄▄▀', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new TristateChart(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'by default, a chart renders `NaN` values as missing values', function test( t ) { - var chart; - var str; - - chart = new TristateChart(); - chart.data = [ -1, 1, NaN, 0, 1, NaN, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '▄▀ ─▀ ▄▀', 'returns rendered chart with missing values' ); - - t.end(); -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new TristateChart(); - chart.data = [ -1, 1, 0, 0, 1, -1, -1, 1 ]; - - str = chart.toString(); - t.strictEqual( str, '▄▀──▀▄▄▀', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/tristate/test/test.push.js b/sparklines/unicode/tristate/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/tristate/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/up-down/README.md b/sparklines/unicode/up-down/README.md deleted file mode 100644 index 8be6068..0000000 --- a/sparklines/unicode/up-down/README.md +++ /dev/null @@ -1,470 +0,0 @@ - - -# Up/Down Chart - -> Create a Unicode sparkline up/down chart. - -
- -## Usage - -```javascript -var UpDownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); -``` - -#### UpDownChart( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new UpDownChart(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. - -* * * - -### Writable Properties - - - -#### UpDownChart.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new UpDownChart(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### UpDownChart.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new UpDownChart(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### UpDownChart.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Int8Array = require( '@stdlib/array/int8' ); - -var chart = new UpDownChart(); - -// Set: -chart.data = new Int8Array( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); - -// Get: -var data = chart.data; -// returns [ -1, 1, 1, 1, 1, -1, -1, 1 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### UpDownChart.prototype.description - -Chart description. - -```javascript -var chart = new UpDownChart(); - -// Set: -chart.description = 'Wins and losses for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Wins and losses for the past 30 days.' -``` - - - -#### UpDownChart.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - // Only consider "wins" as defined: - return ( d === 1 ); -} - -var chart = new UpDownChart(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is to ignore any values which are not `1` or `-1`. - - - -#### UpDownChart.prototype.label - -Data label. - -```javascript -var chart = new UpDownChart(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - -* * * - -### Methods - - - -#### UpDownChart.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new UpDownChart( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### UpDownChart.prototype.render() - -Renders an up/down chart sparkline. - -```javascript -var chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); - -var str = chart.render(); -// returns '↓↑↑↑↑↓↓↑' -``` - -Glyphs: - -| Value | Glyph | -| :---: | :---: | -| 1 | ↑ | -| -1 | ↓ | - -If provided any other value other than `1` or `-1`, the value is encoded as a missing value. - - - -#### UpDownChart.prototype.toString() - -Serializes an up/down chart sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); - -var str = chart.toString(); -// returns '↓↑↑↑↑↓↓↑' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new UpDownChart(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new UpDownChart(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var updownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); - -var chart; -var data; -var id; -var i; - -function datum() { - var d = randu(); - if ( d > 0.75 ) { - d = 1; - } else { - d = -1; - } - return d; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new up/down chart: -chart = updownChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline-updown [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline-updown --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline-updown --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline-updown -- -1 1 1 1 1 -1 -1 1 -↓↑↑↑↑↓↓↑ -``` - -```bash -$ echo -n $'-1\n1\n1\n1\n1\n-1\n-1\n1\n' | sparkline-updown -↓↑↑↑↑↓↓↑ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/up-down/benchmark/benchmark.js b/sparklines/unicode/up-down/benchmark/benchmark.js deleted file mode 100644 index e377dff..0000000 --- a/sparklines/unicode/up-down/benchmark/benchmark.js +++ /dev/null @@ -1,295 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var UpDownChart = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UpDownChart(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = UpDownChart; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UpDownChart( opts ); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UpDownChart( [ 1, 2, 3 ] ); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new UpDownChart( [ 1, 2, 3 ], opts ); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof UpDownChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new UpDownChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/up-down/benchmark/benchmark.render.js b/sparklines/unicode/up-down/benchmark/benchmark.render.js deleted file mode 100644 index ab7579f..0000000 --- a/sparklines/unicode/up-down/benchmark/benchmark.render.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Int8Array = require( '@stdlib/array/int8' ); -var pkg = require( './../package.json' ).name; -var UpDownChart = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {UpDownChart} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var x; - var r; - var i; - - x = new Int8Array( len ); - for ( i = 0; i < x.length; i++ ) { - r = randu(); - if ( r > 0.5 ) { - x[ i ] = 1; - } else { - x[ i ] = -1; - } - } - chart.data = x; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( randu() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new UpDownChart({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/up-down/bin/cli b/sparklines/unicode/up-down/bin/cli deleted file mode 100755 index 3ea2f05..0000000 --- a/sparklines/unicode/up-down/bin/cli +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/up-down/docs/repl.txt b/sparklines/unicode/up-down/docs/repl.txt deleted file mode 100644 index 5a10962..0000000 --- a/sparklines/unicode/up-down/docs/repl.txt +++ /dev/null @@ -1,83 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a sparkline up/down chart instance. - - Glyphs: - - | Value | Glyph | - |:-----:|:-----:| - | 1 | ↑ | - | -1 | ↓ | - - If provided any other value other than 1 or -1, the value is encoded as a - missing value. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - Returns - ------- - chart: UpDownChart - Chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore any values which are not 1 or -1. - - chart.render() - Renders an up/down chart sparkline. - - Examples - -------- - > var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '↓↑↑↑↑↓↓↑' - - See Also - -------- - diff --git a/sparklines/unicode/up-down/docs/usage.txt b/sparklines/unicode/up-down/docs/usage.txt deleted file mode 100644 index 9309952..0000000 --- a/sparklines/unicode/up-down/docs/usage.txt +++ /dev/null @@ -1,8 +0,0 @@ - -Usage: sparkline-updown [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. diff --git a/sparklines/unicode/up-down/etc/cli_opts.json b/sparklines/unicode/up-down/etc/cli_opts.json deleted file mode 100644 index 7c40f9a..0000000 --- a/sparklines/unicode/up-down/etc/cli_opts.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "string": [ - "split" - ], - "boolean": [ - "help", - "version" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/up-down/examples/index.js b/sparklines/unicode/up-down/examples/index.js deleted file mode 100644 index 85e70a7..0000000 --- a/sparklines/unicode/up-down/examples/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var updown = require( './../lib' ); - -var chart; -var data; -var str; -var d; -var i; - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - d = randu(); - if ( d > 0.75 ) { - d = 1; - } else { - d = -1; - } - data[ i ] = d; -} - -// Create a new up/down chart: -chart = updown( data ); - -// Render the chart as a string: -str = chart.render(); - -console.log( str ); -// => '...' diff --git a/sparklines/unicode/up-down/examples/update.js b/sparklines/unicode/up-down/examples/update.js deleted file mode 100644 index f72b42c..0000000 --- a/sparklines/unicode/up-down/examples/update.js +++ /dev/null @@ -1,80 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var updown = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -function datum() { - var d = randu(); - if ( d > 0.75 ) { - d = 1; - } else { - d = -1; - } - return d; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new up/down chart: -chart = updown( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/up-down/lib/index.js b/sparklines/unicode/up-down/lib/index.js deleted file mode 100644 index e673157..0000000 --- a/sparklines/unicode/up-down/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline up/down chart. -* -* @module @stdlib/plot/sparklines/unicode/up-down -* -* @example -* var updownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); -* -* var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; -* -* var chart = updownChart( data ); -* -* var str = chart.render(); -* // returns '↓↑↑↑↑↓↓↑' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/up-down/lib/main.js b/sparklines/unicode/up-down/lib/main.js deleted file mode 100644 index c8c8d33..0000000 --- a/sparklines/unicode/up-down/lib/main.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../../sparklines/base/ctor' ); - - -// MAIN // - -/** -* Unicode sparkline up/down chart constructor. -* -* @constructor -* @param {(ArrayLike|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(ArrayLikeObject|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @throws {TypeError} must provide valid options -* @returns {UpDownChart} chart instance -* -* @example -* var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; -* -* var chart = new UpDownChart( data ); -* -* var str = chart.render(); -* // returns '↓↑↑↑↑↓↓↑' -* -* @example -* var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; -* var opts = { -* 'data': data -* }; -* var chart = new UpDownChart( opts ); -* -* var str = chart.render(); -* // returns '↓↑↑↑↑↓↓↑' -*/ -function UpDownChart() { - var nargs; - - nargs = arguments.length; - if ( !(this instanceof UpDownChart) ) { - if ( nargs === 0 ) { - return new UpDownChart(); - } - if ( nargs === 1 ) { - return new UpDownChart( arguments[ 0 ] ); - } - return new UpDownChart( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( UpDownChart, Sparkline ); - -/** -* Renders a sparkline up/down chart. -* -* @private -* @name _render -* @memberof UpDownChart.prototype -* @type {Function} -* @returns {string} rendered sparkline up/down chart -* -* @example -* var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; -* -* var chart = new UpDownChart( data ); -* -* var str = chart.render(); -* // returns '↓↑↑↑↑↓↓↑' -*/ -UpDownChart.prototype._render = require( './render.js' ); // eslint-disable-line no-underscore-dangle - - -// EXPORTS // - -module.exports = UpDownChart; diff --git a/sparklines/unicode/up-down/lib/render.js b/sparklines/unicode/up-down/lib/render.js deleted file mode 100644 index 5856dd6..0000000 --- a/sparklines/unicode/up-down/lib/render.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// VARIABLES // - -var UP = '↑'; // U+2191 -var DOWN = '↓'; // U+2193 -var MISSING_VALUE = ' '; - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var str; - var len; - var d; - var i; - - len = this._data.length; - if ( len === 0 ) { - return ''; - } - // Generate the sparkline chart, assigning a glyph to each datum... - str = ''; - - // TODO: "down" values diff color (red) (?) - - // TODO: specify bkgd color for streaks of a given length (?) - - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( !this._isDefined( d, i ) ) { - str += MISSING_VALUE; - } else if ( d === 1 ) { - str += UP; - } else if ( d === -1 ) { - str += DOWN; - } else { - str += MISSING_VALUE; - } - } - return str; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/up-down/package.json b/sparklines/unicode/up-down/package.json deleted file mode 100644 index 7a423e8..0000000 --- a/sparklines/unicode/up-down/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode/up-down", - "version": "0.0.0", - "description": "Create a Unicode sparkline up/down chart.", - "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" - } - ], - "bin": { - "sparkline-updown": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "win", - "up", - "loss", - "down", - "draw", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode" - ] -} diff --git a/sparklines/unicode/up-down/test/fixtures/stdin_error.js.txt b/sparklines/unicode/up-down/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/up-down/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/up-down/test/test.auto_render.js b/sparklines/unicode/up-down/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/up-down/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/up-down/test/test.buffer_size.js b/sparklines/unicode/up-down/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/up-down/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/up-down/test/test.cli.js b/sparklines/unicode/up-down/test/test.cli.js deleted file mode 100644 index c9469e1..0000000 --- a/sparklines/unicode/up-down/test/test.cli.js +++ /dev/null @@ -1,267 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders an up/down chart', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'--\'; process.argv[ 3 ] = \'-1\'; process.argv[ 4 ] = \'1\'; process.argv[ 5 ] = \'1\'; process.argv[ 6 ] = \'1\'; process.argv[ 7 ] = \'1\'; process.argv[ 8 ] = \'-1\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '↓↑↑↑↑↓\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\n1\n1\n1\n1\n-1"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '↓↑↑↑↑↓\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\t1\t1\t1\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '↓↑↑↑↑↓\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf -- "-1\t1\t1\t1\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '↓↑↑↑↑↓\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/up-down/test/test.data.js b/sparklines/unicode/up-down/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/up-down/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/up-down/test/test.description.js b/sparklines/unicode/up-down/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/up-down/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/up-down/test/test.is_defined.js b/sparklines/unicode/up-down/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/up-down/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/up-down/test/test.js b/sparklines/unicode/up-down/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/up-down/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/up-down/test/test.label.js b/sparklines/unicode/up-down/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/up-down/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/up-down/test/test.main.js b/sparklines/unicode/up-down/test/test.main.js deleted file mode 100644 index 9aecd82..0000000 --- a/sparklines/unicode/up-down/test/test.main.js +++ /dev/null @@ -1,392 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var UpDownChart = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof UpDownChart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new UpDownChart(); - t.strictEqual( chart instanceof UpDownChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = UpDownChart; - chart = ctor(); - - t.strictEqual( chart instanceof UpDownChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = UpDownChart; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof UpDownChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = UpDownChart; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof UpDownChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = UpDownChart; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof UpDownChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new UpDownChart( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new UpDownChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UpDownChart({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UpDownChart( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UpDownChart({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new UpDownChart( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UpDownChart(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new UpDownChart( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new UpDownChart(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new UpDownChart( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UpDownChart(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new UpDownChart( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UpDownChart(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new UpDownChart( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new UpDownChart(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new UpDownChart( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new UpDownChart(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new UpDownChart(); - chart.data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '↓↑↑↑↑↓↓↑', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new UpDownChart(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'by default, a chart renders values which are not `-1` or `1` as missing values', function test( t ) { - var chart; - var str; - - chart = new UpDownChart(); - chart.data = [ -1, 1, NaN, 1, 1, 5, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '↓↑ ↑↑ ↓↑', 'returns rendered chart with missing values' ); - - t.end(); -}); - -tape( 'a chart supports filtering `1` or `-1` as missing values', function test( t ) { - var chart; - var str; - - chart = new UpDownChart(); - chart.isDefined = isDefined; - chart.data = [ -1, 1, -1, 1, 1, -1, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, ' ↑ ↑↑ ↑', 'returns rendered chart with missing values' ); - - t.end(); - - function isDefined( d ) { - return d === 1; - } -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new UpDownChart(); - chart.data = [ -1, 1, 1, 1, 1, -1, -1, 1 ]; - - str = chart.toString(); - t.strictEqual( str, '↓↑↑↑↑↓↓↑', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/up-down/test/test.push.js b/sparklines/unicode/up-down/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/up-down/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/win-loss/README.md b/sparklines/unicode/win-loss/README.md deleted file mode 100644 index 6784157..0000000 --- a/sparklines/unicode/win-loss/README.md +++ /dev/null @@ -1,497 +0,0 @@ - - -# Win/Loss Chart - -> Create a Unicode sparkline win/loss chart. - -
- -## Usage - -```javascript -var WinLossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); -``` - -#### WinLossChart( \[data,] \[options] ) - -Returns a chart instance. - -```javascript -var chart = new WinLossChart(); -``` - -The constructor accepts the following `options`: - -- **autoRender**: `boolean` indicating whether to re-render on a `change` event. -- **bufferSize**: data buffer size. If provided, data is kept in a first-in first-out (FIFO) buffer which cannot exceed the buffer size. Default: `+infinity`. -- **data**: chart data. -- **description**: chart description. -- **isDefined**: accessor `function` indicating whether a datum is defined. -- **label**: data label. - -* * * - -### Writable Properties - - - -#### WinLossChart.prototype.autoRender - -Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. - -```javascript -var chart = new WinLossChart(); - -// Set: -chart.autoRender = false; - -// Get: -var mode = chart.autoRender; -// returns false -``` - - - -#### WinLossChart.prototype.bufferSize - -Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. - -```javascript -var chart = new WinLossChart(); - -// Set: -chart.bufferSize = 3; - -// Get: -var size = chart.bufferSize; -// returns 3 - -chart.data = [ 1, 2, 3 ]; - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 2, 3, 4 ] -``` - -Setting a data buffer size is useful when rendering data streams. - - - -#### WinLossChart.prototype.data - -Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. - -```javascript -var Int8Array = require( '@stdlib/array/int8' ); - -var chart = new WinLossChart(); - -// Set: -chart.data = new Int8Array( [ -2, 1, 2, 2, 1, -1, -1, 1 ] ); - -// Get: -var data = chart.data; -// returns [ -2, 1, 2, 2, 1, -1, -1, 1 ] -``` - -Note that data is **copied** to an internal data buffer. - - - -#### WinLossChart.prototype.description - -Chart description. - -```javascript -var chart = new WinLossChart(); - -// Set: -chart.description = 'Wins and losses for the past 30 days.'; - -// Get: -var desc = chart.description; -// returns 'Wins and losses for the past 30 days.' -``` - - - -#### WinLossChart.prototype.isDefined( d, i ) - -An accessor `function` which defines whether a datum is defined. This accessor is used to define how missing values are encoded. When invoked, the function is provided two arguments: - -- **d**: datum. -- **i**: datum index. - -```javascript -function isDefined( d ) { - // Ignore home losses: - return ( d !== -2 ); -} - -var chart = new WinLossChart(); - -// Set: -chart.isDefined = isDefined; - -// Get: -var fcn = chart.isDefined; -// returns -``` - -The default behavior is to ignore any values which are not `1`, `-1`, `2`, or `-2`. - - - -#### WinLossChart.prototype.label - -Data label. - -```javascript -var chart = new WinLossChart(); - -// Set: -chart.label = 'beep'; - -// Get: -var label = chart.label; -// returns 'beep' -``` - -* * * - -### Methods - - - -#### WinLossChart.prototype.push( datum ) - -Appends data to a chart. - -```javascript -var chart = new WinLossChart( [ 1, 2, 3 ] ); - -var data = chart.data; -// returns [ 1, 2, 3 ] - -chart.push( 4 ); - -data = chart.data; -// returns [ 1, 2, 3, 4 ] -``` - - - -#### WinLossChart.prototype.render() - -Renders a win/loss chart sparkline. - -```javascript -var chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); - -var str = chart.render(); -// returns '┌╵└┴╵╷╷╵┌┬' -``` - -Glyphs: - -| Value | Glyph | -| :---: | :---: | -| 1 | ╵ | -| -1 | ╷ | -| 2 | └ | -| -2 | ┌ | - -If a `2` or `-2` is preceded by a `2` or `-2`, - -| Value | Glyph | -| :---: | :---: | -| 2 | ┴ | -| -2 | ┬ | - -Based on the win/loss analogy, - -- `1`: win away -- `-1`: loss away -- `2`: win at home -- `-2`: loss at home - -If provided any value other than `1`, `-1`, `2`, or `-2`, the value is encoded as a missing value. - - - -#### WinLossChart.prototype.toString() - -Serializes a win/loss chart sparkline as a `string` by calling the `render()` method. - -```javascript -var chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); - -var str = chart.toString(); -// returns '┌╵└┴╵╷╷╵┌┬' -``` - -* * * - -### Events - -#### 'change' - -Emitted whenever a property value changes. - -```javascript -var chart = new WinLossChart(); - -chart.on( 'change', onChange ); - -function onChange() { - console.log( 'A property was updated.' ); -} -``` - -#### 'render' - -Emitted whenever a sparkline is rendered. - -```javascript -var chart = new WinLossChart(); - -chart.on( 'render', onRender ); - -function onRender( str ) { - console.log( 'Rendered sparkline: %s', str ); -} -``` - -
- - - -
- -
- - - -
- -* * * - -## Examples - - - - - -```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var winlossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); - -var chart; -var data; -var id; -var i; - -// Based on GS Warriors winning percentages for 2015-2016... -function datum() { - var d = randu(); - if ( d > 0.5 ) { // home - d = randu(); - if ( d < 0.057 ) { // loss - d = -2; - } else { // win - d = 2; - } - } else { // away - d = randu(); - if ( d < 0.229 ) { // loss - d = -1; - } else { // win - d = 1; - } - } - return d; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new win/loss chart: -chart = winlossChart( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} -``` - -
- - - -* * * - -
- -## CLI - -
- -### Usage - -```text -Usage: sparkline-winloss [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. -``` - -
- - - -
- -### Notes - -- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is properly **escaped**. - - ```bash - # Not escaped... - $ echo -n $'1\n2\n3\n' | sparkline-winloss --split /\r?\n/ - - # Escaped... - $ echo -n $'1\n2\n3\n' | sparkline-winloss --split /\\r?\\n/ - ``` - -
- - - -
- -### Examples - -```bash -$ sparkline-winloss -- -2 1 2 2 1 -1 -1 1 -2 -2 -┌╵└┴╵╷╷╵┌┬ -``` - -```bash -$ echo -n $'-2\n1\n2\n2\n1\n-1\n-1\n1\n-2\n-2\n' | sparkline-winloss -┌╵└┴╵╷╷╵┌┬ -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/sparklines/unicode/win-loss/benchmark/benchmark.js b/sparklines/unicode/win-loss/benchmark/benchmark.js deleted file mode 100644 index 5b46a43..0000000 --- a/sparklines/unicode/win-loss/benchmark/benchmark.js +++ /dev/null @@ -1,295 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 noop = require( '@stdlib/utils/noop' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArray = require( '@stdlib/assert/is-array' ); -var pkg = require( './../package.json' ).name; -var WinLossChart = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::instantiation', function benchmark( b ) { - var v; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new WinLossChart(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new', function benchmark( b ) { - var ctor; - var v; - var i; - - ctor = WinLossChart; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = ctor(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'data': [ 1, 2, 3 ], - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new WinLossChart( opts ); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data', function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new WinLossChart( [ 1, 2, 3 ] ); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,data,options', function benchmark( b ) { - var opts; - var v; - var i; - - opts = { - 'autoRender': false, - 'bufferSize': 10, - 'description': 'foo', - 'label': 'beep', - 'isDefined': noop - }; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = new WinLossChart( [ 1, 2, 3 ], opts ); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - } - b.toc(); - if ( !( v instanceof WinLossChart ) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:autoRender', function benchmark( b ) { - var bool; - var v; - var i; - - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.autoRender = !bool; - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( typeof v.autoRender !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:bufferSize', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 10, - 20, - 30 - ]; - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.bufferSize = values[ i % values.length ]; - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( typeof v.bufferSize !== 'number' ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:data', function benchmark( b ) { - var v; - var i; - - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.data = [ randu(), randu(), randu() ]; - if ( typeof v.data !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArray( v.data ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:description', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.description = values[ i % values.length ]; - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.description !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::set,get:isDefined', function benchmark( b ) { - var v; - var i; - - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.isDefined = createFcn(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( typeof v.isDefined !== 'function' ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createFcn() { - return beep; - function beep() { - // No-op... - } - } -}); - -bench( pkg+'::set,get:label', function benchmark( b ) { - var values; - var v; - var i; - - values = [ - 'beep', - 'boop' - ]; - v = new WinLossChart(); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v.label = values[ i % values.length ]; - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof v.label !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/sparklines/unicode/win-loss/benchmark/benchmark.render.js b/sparklines/unicode/win-loss/benchmark/benchmark.render.js deleted file mode 100644 index 04e1e40..0000000 --- a/sparklines/unicode/win-loss/benchmark/benchmark.render.js +++ /dev/null @@ -1,118 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var Int8Array = require( '@stdlib/array/int8' ); -var pkg = require( './../package.json' ).name; -var WinLossChart = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @param {WinLossChart} chart - chart instance -* @returns {Function} benchmark function -*/ -function createBenchmark( len, chart ) { - var x; - var r; - var i; - - x = new Int8Array( len ); - for ( i = 0; i < x.length; i++ ) { - r = randu(); - if ( r > 0.75 ) { - x[ i ] = 2; - } else if ( r > 0.5 ) { - x[ i ] = 1; - } else if ( r > 0.25 ) { - x[ i ] = -1; - } else { - x[ i ] = -2; - } - } - chart.data = x; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var str; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = chart.push( randu() ).render(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof str !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var chart; - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 4; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - chart = new WinLossChart({ - 'bufferSize': len - }); - f = createBenchmark( len, chart ); - bench( pkg+':render:len='+len, f ); - } -} - -main(); diff --git a/sparklines/unicode/win-loss/bin/cli b/sparklines/unicode/win-loss/bin/cli deleted file mode 100755 index 3ea2f05..0000000 --- a/sparklines/unicode/win-loss/bin/cli +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env node - -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var stdin = require( '@stdlib/process/read-stdin' ); -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var reFromString = require( '@stdlib/utils/regexp-from-string' ); -var stdinStream = require( '@stdlib/streams/node/stdin' ); -var sparkline = require( './../lib' ); - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -* @returns {void} -*/ -function main() { - var flags; - var args; - var opts; - var cli; - var i; - - opts = {}; - - // Create a command-line interface: - cli = new CLI({ - 'pkg': require( './../package.json' ), - 'options': require( './../etc/cli_opts.json' ), - 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }) - }); - - // Get any provided command-line options: - flags = cli.flags(); - if ( flags.help || flags.version ) { - return; - } - - // Get any provided command-line arguments: - args = cli.args(); - - // Check if we are receiving data from `stdin`... - if ( !stdinStream.isTTY ) { - if ( flags.split ) { - if ( !isRegExpString( flags.split ) ) { - flags.split = '/'+flags.split+'/'; - } - opts.split = reFromString( flags.split ); - } else { - opts.split = RE_EOL; - } - return stdin( onRead ); - } - for ( i = 0; i < args.length; i++ ) { - args[ i ] = parseFloat( args[ i ] ); - } - console.log( sparkline( args, opts ).render() ); // eslint-disable-line no-console - - /** - * Callback invoked upon reading from `stdin`. - * - * @private - * @param {(Error|null)} error - error object - * @param {Buffer} data - data - * @returns {void} - */ - function onRead( error, data ) { - var lines; - var i; - if ( error ) { - return cli.error( error ); - } - lines = data.toString().split( opts.split ); - for ( i = 0; i < lines.length; i++ ) { - lines[ i ] = parseFloat( lines[ i ] ); - } - console.log( sparkline( lines, opts ).render() ); // eslint-disable-line no-console - } -} - -main(); diff --git a/sparklines/unicode/win-loss/docs/repl.txt b/sparklines/unicode/win-loss/docs/repl.txt deleted file mode 100644 index 999fbce..0000000 --- a/sparklines/unicode/win-loss/docs/repl.txt +++ /dev/null @@ -1,99 +0,0 @@ - -{{alias}}( [data,] [options] ) - Returns a sparkline win/loss chart instance. - - Glyphs: - - | Value | Glyph | - |:-----:|:-----:| - | 1 | ╵ | - | -1 | ╷ | - | 2 | └ | - | -2 | ┌ | - - If a `2` or `-2` is preceded by a `2` or `-2`, - - | Value | Glyph | - |:-----:|:-----:| - | 2 | ┴ | - | -2 | ┬ | - - Based on the win/loss analogy, - - - 1: win away - - 2: win at home - - -1: loss away - - -2: loss at home - - If provided any value other than 1, -1, 2, or -2, the value is encoded as a - missing value. - - The `data` argument takes precedence over the `data` option. - - Parameters - ---------- - data: ArrayLike|ndarray (optional) - Chart data. - - options: Object (optional) - Options. - - options.autoRender: boolean (optional) - Boolean indicating whether to re-render on a 'change' event. Default: - false. - - options.bufferSize: integer|null (optional) - Data buffer size. If provided, data is kept in a first-in first-out - (FIFO) buffer which cannot exceed the buffer size. Default: +infinity. - - options.data: ArrayLike|ndarray (optional) - Chart data. - - options.description: string (optional) - Chart description. - - options.isDefined: Function (optional) - An accessor function indicating whether a datum is defined. - - options.label: string (optional) - Data label. - - Returns - ------- - chart: WinLossChart - Chart instance. - - chart.autoRender - Rendering mode. If `true`, an instance renders on each 'change' event; - otherwise, rendering must be triggered manually. - - chart.bufferSize - Data buffer size. - - chart.description - Chart description. - - chart.data - Chart data. - - chart.label - Data label. - - chart.isDefined( d, i ) - An accessor function which defines whether a datum is defined. This - accessor is used to define how missing values are encoded. The default - behavior is to ignore any values which are not 1, -1, 2, or -2. - - chart.render() - Renders a win/loss chart sparkline. - - Examples - -------- - > var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ]; - > var chart = new {{alias}}( data ); - > chart.render() - '┌╵└┴╵╷╷╵' - - See Also - -------- - diff --git a/sparklines/unicode/win-loss/docs/usage.txt b/sparklines/unicode/win-loss/docs/usage.txt deleted file mode 100644 index dcc6aa5..0000000 --- a/sparklines/unicode/win-loss/docs/usage.txt +++ /dev/null @@ -1,8 +0,0 @@ - -Usage: sparkline-winloss [options] ... - -Options: - - -h, --help Print this message. - -V, --version Print the package version. - --split sep Separator used to split stdin data. Default: /\\r?\\n/. diff --git a/sparklines/unicode/win-loss/etc/cli_opts.json b/sparklines/unicode/win-loss/etc/cli_opts.json deleted file mode 100644 index 7c40f9a..0000000 --- a/sparklines/unicode/win-loss/etc/cli_opts.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "string": [ - "split" - ], - "boolean": [ - "help", - "version" - ], - "alias": { - "help": [ - "h" - ], - "version": [ - "V" - ] - } -} diff --git a/sparklines/unicode/win-loss/examples/index.js b/sparklines/unicode/win-loss/examples/index.js deleted file mode 100644 index 9e86f2f..0000000 --- a/sparklines/unicode/win-loss/examples/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var winloss = require( './../lib' ); - -var chart; -var data; -var str; -var d; -var i; - -// Generate some random data (based on GS Warriors 2015-2016)... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - d = randu(); - if ( d > 0.5 ) { // home - d = randu(); - if ( d < 0.057 ) { // loss - d = -2; - } else { // win - d = 2; - } - } else { // away - d = randu(); - if ( d < 0.229 ) { // loss - d = -1; - } else { // win - d = 1; - } - } - data[ i ] = d; -} - -// Create a new win/loss chart: -chart = winloss( data ); - -// Render the chart as a string: -str = chart.render(); - -console.log( str ); -// => '...' diff --git a/sparklines/unicode/win-loss/examples/update.js b/sparklines/unicode/win-loss/examples/update.js deleted file mode 100644 index 940a99d..0000000 --- a/sparklines/unicode/win-loss/examples/update.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var winloss = require( './../lib' ); - -var chart; -var data; -var id; -var i; - -// Based on GS Warriors winning percentages for 2015-2016... -function datum() { - var d = randu(); - if ( d > 0.5 ) { // home - d = randu(); - if ( d < 0.057 ) { // loss - d = -2; - } else { // win - d = 2; - } - } else { // away - d = randu(); - if ( d < 0.229 ) { // loss - d = -1; - } else { // win - d = 1; - } - } - return d; -} - -// Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { - data[ i ] = datum(); -} - -// Create a new win/loss chart: -chart = winloss( data ); - -// Hide the terminal cursor: -stdout.write( '\u001b[?25l' ); - -// Render the chart in the terminal: -stdout.write( chart.render() ); - -// Configure the chart to support streaming data: -chart.bufferSize = data.length; - -// Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); - -// After some time, stop updating and close: -setTimeout( stop, 20000 ); - -function update() { - // Update the chart with new data: - chart.push( datum() ); - - // Clear the terminal line and render the chart: - stdout.write( '\r\u001b[2K' + chart.render() ); -} - -function stop() { // eslint-disable-line stdlib/no-redeclare - clearInterval( id ); - - // Restore the terminal cursor: - stdout.write( '\u001b[?25h' ); - - stdout.write( '\n' ); -} diff --git a/sparklines/unicode/win-loss/lib/index.js b/sparklines/unicode/win-loss/lib/index.js deleted file mode 100644 index 60a401f..0000000 --- a/sparklines/unicode/win-loss/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Create a Unicode sparkline win/loss chart. -* -* @module @stdlib/plot/sparklines/unicode/win-loss -* -* @example -* var winlossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); -* -* var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ]; -* -* var chart = winlossChart( data ); -* -* var str = chart.render(); -* // returns '┌╵└┴╵╷╷╵' -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/sparklines/unicode/win-loss/lib/main.js b/sparklines/unicode/win-loss/lib/main.js deleted file mode 100644 index 0ef46b5..0000000 --- a/sparklines/unicode/win-loss/lib/main.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( './../../../../sparklines/base/ctor' ); - - -// MAIN // - -/** -* Unicode sparkline win/loss chart constructor. -* -* @constructor -* @param {(ArrayLike|ndarrayLike)} [data] - chart data -* @param {Options} [options] - chart options -* @param {boolean} [options.autoRender=false] - indicates whether to re-render on a `change` event -* @param {(PositiveInteger|null)} [options.bufferSize] - data buffer size -* @param {(ArrayLikeObject|ndarrayLike)} [options.data] - data -* @param {string} [options.description=''] - chart description -* @param {Function} [options.isDefined] - accessor indicating whether a datum is defined -* @param {string} [options.label] - data label -* @throws {TypeError} must provide valid options -* @returns {WinLossChart} chart instance -* -* @example -* var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ]; -* -* var chart = new WinLossChart( data ); -* -* var str = chart.render(); -* // returns '┌╵└┴╵╷╷╵' -* -* @example -* var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ]; -* var opts = { -* 'data': data -* }; -* var chart = new WinLossChart( opts ); -* -* var str = chart.render(); -* // returns '┌╵└┴╵╷╷╵' -*/ -function WinLossChart() { - var nargs; - - nargs = arguments.length; - if ( !(this instanceof WinLossChart) ) { - if ( nargs === 0 ) { - return new WinLossChart(); - } - if ( nargs === 1 ) { - return new WinLossChart( arguments[ 0 ] ); - } - return new WinLossChart( arguments[ 0 ], arguments[ 1 ] ); - } - // Invoke parent constructor... - if ( nargs === 0 ) { - Sparkline.call( this ); - } else if ( nargs === 1 ) { - Sparkline.call( this, arguments[ 0 ] ); - } else { - Sparkline.call( this, arguments[ 0 ], arguments[ 1 ] ); - } - return this; -} - -/* -* Inherit from the `Sparkline` prototype. -*/ -inherit( WinLossChart, Sparkline ); - -/** -* Renders a sparkline win/loss chart. -* -* @private -* @name _render -* @memberof WinLossChart.prototype -* @type {Function} -* @returns {string} rendered sparkline win/loss chart -* -* @example -* var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ]; -* -* var chart = new WinLossChart( data ); -* -* var str = chart.render(); -* // returns '┌╵└┴╵╷╷╵' -*/ -WinLossChart.prototype._render = require( './render.js' ); // eslint-disable-line no-underscore-dangle - - -// EXPORTS // - -module.exports = WinLossChart; diff --git a/sparklines/unicode/win-loss/lib/render.js b/sparklines/unicode/win-loss/lib/render.js deleted file mode 100644 index 7ce57d1..0000000 --- a/sparklines/unicode/win-loss/lib/render.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -// VARIABLES // - -// See [box-drawing characters]{@link https://en.wikipedia.org/wiki/Box-drawing_character}. -var HOME_WIN = [ - '└', // U+2514 - '┴' // U+2534 -]; -var HOME_LOSS = [ - '┌', // U+250C - '┬' // U+252C -]; -var AWAY_WIN = '╵'; // U+2575 -var AWAY_LOSS = '╷'; // U+2577 - -var MISSING_VALUE = ' '; - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var str; - var len; - var py; - var d; - var i; - - len = this._data.length; - if ( len === 0 ) { - return ''; - } - // Generate the sparkline chart, assigning a glyph to each datum... - str = ''; - - // TODO: "loss" values diff color (red) (?) - - // TODO: specify bkgd color for streaks of a given length (?) - - for ( i = 0; i < len; i++ ) { - d = this._data[ i ]; - if ( !this._isDefined( d, i ) ) { - str += MISSING_VALUE; - } else if ( d === 2 ) { - if ( py === 2 || py === -2 ) { - str += HOME_WIN[ 1 ]; - } else { - str += HOME_WIN[ 0 ]; - } - } else if ( d === 1 ) { - str += AWAY_WIN; - } else if ( d === -1 ) { - str += AWAY_LOSS; - } else if ( d === -2 ) { - if ( py === 2 || py === -2 ) { - str += HOME_LOSS[ 1 ]; - } else { - str += HOME_LOSS[ 0 ]; - } - } else { - str += MISSING_VALUE; - } - py = d; // save the current data value to allow look-back - } - return str; -} - - -// EXPORTS // - -module.exports = render; diff --git a/sparklines/unicode/win-loss/package.json b/sparklines/unicode/win-loss/package.json deleted file mode 100644 index e7219c9..0000000 --- a/sparklines/unicode/win-loss/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@stdlib/plot/sparklines/unicode/win-loss", - "version": "0.0.0", - "description": "Create a Unicode sparkline win/loss chart.", - "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" - } - ], - "bin": { - "sparkline-winloss": "./bin/cli" - }, - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "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", - "win", - "loss", - "draw", - "chart", - "graph", - "graphic", - "data", - "sparklines", - "sparkline", - "visualize", - "viz", - "vis", - "unicode" - ] -} diff --git a/sparklines/unicode/win-loss/test/fixtures/stdin_error.js.txt b/sparklines/unicode/win-loss/test/fixtures/stdin_error.js.txt deleted file mode 100644 index 10f4aca..0000000 --- a/sparklines/unicode/win-loss/test/fixtures/stdin_error.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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. -*/ - -var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; -var proxyquire = require( 'proxyquire' ); - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); - -proc.stdin.isTTY = false; - -proxyquire( fpath, { - '@stdlib/process/read-stdin': stdin -}); - -function stdin( clbk ) { - clbk( new Error( 'beep' ) ); -} diff --git a/sparklines/unicode/win-loss/test/test.auto_render.js b/sparklines/unicode/win-loss/test/test.auto_render.js deleted file mode 100644 index 039c91f..0000000 --- a/sparklines/unicode/win-loss/test/test.auto_render.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `autoRender` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.autoRender = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - chart.autoRender = true; - t.strictEqual( chart.autoRender, true, 'returns expected value' ); - - chart.autoRender = false; - t.strictEqual( chart.autoRender, false, 'returns expected value' ); - - t.end(); -}); - -tape( 'if `autoRender` is `true`, when a returned instance receives a `change` event, it re-renders and emits a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true, - 'data': [ 0.10, 0.50, 0.90 ] - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - function onRender( str ) { - t.ok( true, 'emits a render event' ); - t.strictEqual( typeof str, 'string', 'provides expected value' ); - t.end(); - } -}); - -tape( 'if `autoRender` is `false`, when a returned instance receives a `change` event, it does not re-render or emit a `render` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 0.10, 0.50, 0.90 ], - 'autoRender': false - }); - - chart.on( 'render', onRender ); - chart.emit( 'change' ); - - t.pass( 'is ok' ); - t.end(); - - function onRender() { - t.fail( 'should never be invoked' ); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': true - }); - - chart.on( 'change', onChange ); - chart.autoRender = true; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); - -tape( 'setting the `autoRender` property to an existing value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'autoRender': false - }); - - chart.on( 'change', onChange ); - chart.autoRender = false; - - t.pass( 'is ok' ); - t.end(); - - function onChange() { - t.fail( 'should never be called' ); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.buffer_size.js b/sparklines/unicode/win-loss/test/test.buffer_size.js deleted file mode 100644 index 4bbd121..0000000 --- a/sparklines/unicode/win-loss/test/test.buffer_size.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `bufferSize` value', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 0, - 3.14, - NaN, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `bufferSize` which is less than the number of data elements', function test( t ) { - var values; - var i; - - values = [ - 1, - 2, - 3, - 4, - 5 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'data': [ 1, 2, 3, 4, 5, 6 ] - }); - chart.bufferSize = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - t.strictEqual( chart.bufferSize, 10, 'returns expected value' ); - - chart.bufferSize = 20; - t.strictEqual( chart.bufferSize, 20, 'returns expected value' ); - - chart.bufferSize = 30; - t.strictEqual( chart.bufferSize, 30, 'returns expected value' ); - - chart.bufferSize = null; - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 30; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'bufferSize': 10 - }); - - chart.on( 'change', onChange ); - chart.bufferSize = 10; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.cli.js b/sparklines/unicode/win-loss/test/test.cli.js deleted file mode 100644 index 987ddde..0000000 --- a/sparklines/unicode/win-loss/test/test.cli.js +++ /dev/null @@ -1,267 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 resolve = require( 'path' ).resolve; -var exec = require( 'child_process' ).exec; -var tape = require( 'tape' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var replace = require( '@stdlib/string/replace' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var EXEC_PATH = require( '@stdlib/process/exec-path' ); - - -// VARIABLES // - -var fpath = resolve( __dirname, '..', 'bin', 'cli' ); -var opts = { - 'skip': IS_BROWSER || IS_WINDOWS -}; - - -// FIXTURES // - -var PKG_VERSION = require( './../package.json' ).version; - - -// TESTS // - -tape( 'command-line interface', function test( t ) { - t.ok( true, __filename ); - t.end(); -}); - -tape( 'when invoked with a `--help` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '--help' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-h` flag, the command-line interface prints the help text to `stderr`', opts, function test( t ) { - var expected; - var cmd; - - expected = readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), { - 'encoding': 'utf8' - }); - cmd = [ - EXEC_PATH, - fpath, - '-h' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), expected+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `--version` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '--version' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'when invoked with a `-V` flag, the command-line interface prints the version to `stderr`', opts, function test( t ) { - var cmd = [ - EXEC_PATH, - fpath, - '-V' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), PKG_VERSION+'\n', 'expected value' ); - } - t.end(); - } -}); - -tape( 'the command-line interface renders a win/loss chart', opts, function test( t ) { - var opts; - var cmd; - - cmd = [ - EXEC_PATH, - '-e', - '"process.stdin.isTTY = true; process.argv[ 2 ] = \'--\'; process.argv[ 3 ] = \'-2\'; process.argv[ 4 ] = \'1\'; process.argv[ 5 ] = \'2\'; process.argv[ 6 ] = \'2\'; process.argv[ 7 ] = \'1\'; process.argv[ 8 ] = \'-1\'; require( \''+fpath+'\' );"' - ]; - opts = {}; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '┌╵└┴╵╷\n', 'prints expected results to stdout' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports use as a standard stream', opts, function test( t ) { - var cmd = [ - 'printf -- "-2\n1\n2\n2\n1\n-1"', - '|', - EXEC_PATH, - fpath - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '┌╵└┴╵╷\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (regexp)', opts, function test( t ) { - var cmd = [ - 'printf -- "-2\t1\t2\t2\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=/\\t/\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '┌╵└┴╵╷\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'the command-line interface supports providing a custom separator when used as a standard stream (string)', opts, function test( t ) { - var cmd = [ - 'printf -- "-2\t1\t2\t2\t1\t-1"', - '|', - EXEC_PATH, - '-e', - '"process.stdin.isTTY = false; process.argv[ 2 ] = \'--split=\\t\'; require( \''+fpath+'\' );"' - ]; - - exec( cmd.join( ' ' ), done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.fail( error.message ); - } else { - t.strictEqual( stdout.toString(), '┌╵└┴╵╷\n', 'expected value' ); - t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' ); - } - t.end(); - } -}); - -tape( 'when used as a standard stream, if an error is encountered when reading from `stdin`, the command-line interface prints an error and sets a non-zero exit code', opts, function test( t ) { - var script; - var opts; - var cmd; - - script = readFileSync( resolve( __dirname, 'fixtures', 'stdin_error.js.txt' ), { - 'encoding': 'utf8' - }); - - // Replace single quotes with double quotes: - script = replace( script, '\'', '"' ); - - cmd = [ - EXEC_PATH, - '-e', - '\''+script+'\'' - ]; - - opts = { - 'cwd': __dirname - }; - - exec( cmd.join( ' ' ), opts, done ); - - function done( error, stdout, stderr ) { - if ( error ) { - t.pass( error.message ); - t.strictEqual( error.code, 1, 'expected exit code' ); - } - t.strictEqual( stdout.toString(), '', 'does not print to `stdout`' ); - t.strictEqual( stderr.toString(), 'Error: beep\n', 'expected value' ); - t.end(); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.data.js b/sparklines/unicode/win-loss/test/test.data.js deleted file mode 100644 index a28b01c..0000000 --- a/sparklines/unicode/win-loss/test/test.data.js +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `data` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.data = value; - }; - } -}); - -tape( 'an instance throws an error if provided a `data` value which more data elements than the data buffer size', function test( t ) { - var values; - var i; - - values = [ - [ 1, 2 ], - [ 1, 2, 3 ], - [ 1, 2, 3, 4 ] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor({ - 'bufferSize': 1 - }); - chart.data = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - var arr; - - arr = [ 1, 2, 3 ]; - chart = ctor({ - 'data': arr - }); - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = [ 4, 5, 6 ]; - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, arr, 'returns expected value' ); - - arr = ndarray( 'generic', [ 7, 8, 9 ], [ 3 ], [ 1 ], 0, 'row-major' ); - chart.data = arr; - t.notEqual( chart.data, arr, 'returns a new reference' ); - t.deepEqual( chart.data, [ 7, 8, 9 ], 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `data` property triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.data = [ 4, 5, 6 ]; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.description.js b/sparklines/unicode/win-loss/test/test.description.js deleted file mode 100644 index b2222e1..0000000 --- a/sparklines/unicode/win-loss/test/test.description.js +++ /dev/null @@ -1,113 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `description` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - true, - false, - null, - void 0, - {}, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.description = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - t.strictEqual( chart.description, 'beep', 'returns expected value' ); - - chart.description = 'boop'; - t.strictEqual( chart.description, 'boop', 'returns expected value' ); - - chart.description = 'foo'; - t.strictEqual( chart.description, 'foo', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'boop'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'description': 'beep' - }); - - chart.on( 'change', onChange ); - chart.description = 'beep'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.is_defined.js b/sparklines/unicode/win-loss/test/test.is_defined.js deleted file mode 100644 index deaa3d7..0000000 --- a/sparklines/unicode/win-loss/test/test.is_defined.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `isDefined` value', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - {}, - [] - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.isDefined = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - t.strictEqual( chart.isDefined, noop, 'returns expected value' ); - - chart.isDefined = isDefined; - t.strictEqual( chart.isDefined, isDefined, 'returns expected value' ); - - t.end(); - - function isDefined( d ) { - return d === d; - } -}); - -tape( 'the default behavior is to treat `NaN` values as undefined', function test( t ) { - var chart = ctor(); - t.strictEqual( chart.isDefined( NaN ), false, 'returns expected value' ); - t.strictEqual( chart.isDefined( 5 ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( null ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( '' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( [] ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( {} ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( 'foo' ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( true ), true, 'returns expected value' ); - t.strictEqual( chart.isDefined( false ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = isDefined; - - function isDefined( d ) { - return d === d; - } - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'isDefined': noop - }); - - chart.on( 'change', onChange ); - chart.isDefined = noop; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.js b/sparklines/unicode/win-loss/test/test.js deleted file mode 100644 index 5e5bc79..0000000 --- a/sparklines/unicode/win-loss/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Chart = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Chart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new Chart(); - t.strictEqual( chart instanceof Chart, true, 'returns class instance' ); - t.end(); -}); diff --git a/sparklines/unicode/win-loss/test/test.label.js b/sparklines/unicode/win-loss/test/test.label.js deleted file mode 100644 index d008ba5..0000000 --- a/sparklines/unicode/win-loss/test/test.label.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'an instance throws an error if provided an invalid `label` value', function test( t ) { - var values; - var i; - - values = [ - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - [ 'beep' ], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = ctor(); - chart.label = value; - }; - } -}); - -tape( 'an instance supports setting and getting the property value', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'beep' - }); - t.strictEqual( chart.label, 'beep', 'returns expected value' ); - - chart.label = 'boop'; - t.strictEqual( chart.label, 'boop', 'returns expected value' ); - - t.end(); -}); - -tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'b'; - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); - -tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'label': 'a' - }); - - chart.on( 'change', onChange ); - chart.label = 'a'; - - t.ok( true, 'does not trigger event' ); - t.end(); - - function onChange() { - t.ok( false, 'should not trigger event' ); - } -}); diff --git a/sparklines/unicode/win-loss/test/test.main.js b/sparklines/unicode/win-loss/test/test.main.js deleted file mode 100644 index eafaa73..0000000 --- a/sparklines/unicode/win-loss/test/test.main.js +++ /dev/null @@ -1,392 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var noop = require( '@stdlib/utils/noop' ); -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); -var WinLossChart = require( './../lib/main.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof WinLossChart, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the export is a class constructor', function test( t ) { - var chart = new WinLossChart(); - t.strictEqual( chart instanceof WinLossChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) { - var chart; - var ctor; - - ctor = WinLossChart; - chart = ctor(); - - t.strictEqual( chart instanceof WinLossChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data)', function test( t ) { - var chart; - var ctor; - - ctor = WinLossChart; - chart = ctor( [ 1, 2, 3 ] ); - - t.strictEqual( chart instanceof WinLossChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var chart; - var ctor; - - ctor = WinLossChart; - chart = ctor({ - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'data': [ 1, 2, 3 ], - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof WinLossChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) { - var chart; - var ctor; - - ctor = WinLossChart; - chart = ctor( [ 1, 2, 3 ], { - 'bufferSize': 10, - 'description': 'beep', - 'isDefined': noop, - 'autoRender': true, - 'label': 'foo' - }); - - t.strictEqual( chart instanceof WinLossChart, true, 'returns class instance' ); - t.end(); -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new WinLossChart( value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - null, - void 0, - true, - false, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var chart = new WinLossChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new WinLossChart({ - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) { - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new WinLossChart( [ 1, 2, 3 ], { - 'description': [] - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new WinLossChart({ - 'data': [ 1, 2, 3, 4, 5 ], - 'bufferSize': 3 - }); - } -}); - -tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) { - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - // eslint-disable-next-line no-unused-vars - var chart = new WinLossChart( [ 1, 2, 3, 4, 5 ], { - 'bufferSize': 3 - }); - } -}); - -tape( 'an instance has a writable `autoRender` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new WinLossChart(); - t.strictEqual( chart.autoRender, false, 'default value is false' ); - - opts = { - 'autoRender': true - }; - chart = new WinLossChart( opts ); - - expected = true; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - chart.autoRender = false; - - expected = false; - t.strictEqual( chart.autoRender, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `bufferSize` property', function test( t ) { - var chart; - var opts; - - chart = new WinLossChart(); - t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' ); - - opts = { - 'bufferSize': 20 - }; - chart = new WinLossChart( opts ); - t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' ); - - chart.bufferSize = 5; - t.strictEqual( chart.bufferSize, 5, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `data` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new WinLossChart(); - t.deepEqual( chart.data, [], 'default value is an empty array' ); - - opts = { - 'data': [ 1, 2, 3 ] - }; - chart = new WinLossChart( opts ); - - expected = [ 1, 2, 3 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - chart.data = [ 4, 5, 6 ]; - - expected = [ 4, 5, 6 ]; - t.deepEqual( chart.data, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `isDefined` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new WinLossChart(); - t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' ); - - opts = { - 'isDefined': noop - }; - chart = new WinLossChart( opts ); - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - chart.isDefined = noop; - - expected = noop; - t.deepEqual( chart.isDefined, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a writable `label` property', function test( t ) { - var expected; - var chart; - var opts; - - chart = new WinLossChart(); - t.strictEqual( chart.label, '', 'default value is an empty string' ); - - opts = { - 'label': 'foo' - }; - chart = new WinLossChart( opts ); - - expected = 'foo'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - chart.label = 'bar'; - - expected = 'bar'; - t.strictEqual( chart.label, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'an instance has a `push` method for appending data', function test( t ) { - var chart = new WinLossChart(); - t.strictEqual( typeof chart.push, 'function', 'has push method' ); - t.end(); -}); - -tape( 'an instance has a `render` method for rendering a chart', function test( t ) { - var chart; - var str; - - chart = new WinLossChart(); - chart.data = [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2, 2, 2, -2 ]; - - str = chart.render(); - t.strictEqual( str, '┌╵└┴╵╷╷╵┌┬┴┴┬', 'returns rendered chart' ); - - t.end(); -}); - -tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) { - var chart; - var str; - - chart = new WinLossChart(); - - str = chart.render(); - t.strictEqual( str, '', 'returns empty string' ); - - t.end(); -}); - -tape( 'by default, a chart renders values which are not `-1, 1, -2, 2` as missing values', function test( t ) { - var chart; - var str; - - chart = new WinLossChart(); - chart.data = [ -2, 1, NaN, 2, 1, 5, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, '┌╵ └╵ ╷╵', 'returns rendered chart with missing values' ); - - t.end(); -}); - -tape( 'a chart supports treating `-1`, `1`, `-2` or `2` as missing values', function test( t ) { - var chart; - var str; - - chart = new WinLossChart(); - chart.isDefined = isDefined; - chart.data = [ -2, 1, -2, 2, 1, -2, -1, 1 ]; - - str = chart.render(); - t.strictEqual( str, ' ╵ ┴╵ ╷╵', 'returns rendered chart with missing values' ); - - t.end(); - - function isDefined( d ) { - return d !== -2; - } -}); - -tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) { - var chart; - var str; - - chart = new WinLossChart(); - chart.data = [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ]; - - str = chart.toString(); - t.strictEqual( str, '┌╵└┴╵╷╷╵┌┬', 'returns rendered chart' ); - - t.end(); -}); diff --git a/sparklines/unicode/win-loss/test/test.push.js b/sparklines/unicode/win-loss/test/test.push.js deleted file mode 100644 index cdd005b..0000000 --- a/sparklines/unicode/win-loss/test/test.push.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function appends a datum to the chart data', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 1, 2, 3, 4 ]; - t.deepEqual( v, expected, 'appends to chart data' ); - - t.end(); -}); - -tape( 'if appending data to the internal data buffer will result in the chart data exceeding the data buffer size, the function will remove the first data element', function test( t ) { - var expected; - var chart; - var data; - var v; - - data = [ 1, 2, 3 ]; - chart = ctor({ - 'data': data, - 'bufferSize': 3 - }); - - chart.push( 4 ); - v = chart.data; - - expected = [ 2, 3, 4 ]; - t.deepEqual( v, expected, 'removes first data element' ); - - t.end(); -}); - -tape( 'appending `data` triggers a `change` event', function test( t ) { - var chart; - - chart = ctor({ - 'data': [ 1, 2, 3 ] - }); - - chart.on( 'change', onChange ); - chart.push( 4 ); - - function onChange() { - t.ok( true, 'triggers event' ); - t.end(); - } -}); diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..aded28f --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 54ed363..0000000 --- a/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Plot = require( './../ctor' ); -var plot = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof plot, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the main export is a plot constructor', function test( t ) { - t.strictEqual( plot, Plot, 'is alias' ); - t.end(); -}); diff --git a/unicode/stemleaf/examples/index.js b/unicode/stemleaf/examples/index.js deleted file mode 100644 index d067f8d..0000000 --- a/unicode/stemleaf/examples/index.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 array-element-newline */ - -'use strict'; - -var StemLeaf = require( './../lib' ); - -var chart; -var x; -var y; - -// Data from [RosettaCode]{@link https://www.rosettacode.org/wiki/Stem-and-leaf_plot#Python} -x = [ - 12, 127, 28, 42, 39, 113, 42, 18, 44, 118, 44, 37, 113, 124, 37, - 48, 127, 36, 29, 31, 125, 139, 131, 115, 105, 132, 104, 123, 35, - 113, 122, 42, 117, 119, 58, 109, 23, 105, 63, 27, 44, 105, 99, - 41, 128, 121, 116, 125, 32, 61, 37, 127, 29, 113, 121, 58, 114 -]; -y = [ - 126, 53, 114, 96, 25, 109, 7, 31, 141, 46, 13, 27, 43, 117, 116, - 27, 7, 68, 40, 31, 115, 124, 42, 128, 52, 71, 118, 117, 38, 27, - 106, 33, 117, 116, 111, 40, 119, 47, 105, 57, 122, 109, 124, 115, - 43, 120, 43, 27, 27, 18, 28, 48, 125, 107, 114, 34, 133, 45, 120, - 30, 127, 31, 116, 146 -]; - -// Only x values: -chart = new StemLeaf({ - 'x': x -}); -console.log( chart.render() ); - -// Only y values: -chart = new StemLeaf({ - 'y': y -}); -console.log( chart.render() ); - -// Compare x and y values: -chart = new StemLeaf({ - 'x': x, - 'y': y -}); -console.log( chart.render() ); diff --git a/unicode/stemleaf/lib/format_data.js b/unicode/stemleaf/lib/format_data.js deleted file mode 100644 index 3833fb4..0000000 --- a/unicode/stemleaf/lib/format_data.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); -var round = require( '@stdlib/math/base/special/round' ); -var isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); - - -// MAIN // - -/** -* Formats data to a standard representation. This is required for non-deterministic accessors. -* -* @private -* @param {(Array|TypedArray)} data - data to standardize -* @param {Function} getValue - accessor function -* @returns {ObjectArray} standardized data -* -* @example -* var data = [{'y':5.0},{'y':3.0},{'y':2.0}]; -* function yValue( d ) { -* return d.y; -* } -* var arr = formatData( data, yValue ); -* // returns [ 5.0, 3.0, 2.0 ] -*/ -function formatData( data, getValue ) { - var out; - var d; - var i; - - // TODO: add support for `ndarray`-like interfaces - - out = new Array( data.length ); - for ( i = 0; i < data.length; i++ ) { - d = getValue( data[ i ], i ); - if ( isnan( d ) || isInfinite( d ) ) { - continue; - } - out[ i ] = round( d ); - } - - return out; -} - - -// EXPORTS // - -module.exports = formatData; diff --git a/unicode/stemleaf/lib/get_x.js b/unicode/stemleaf/lib/get_x.js deleted file mode 100644 index 159490a..0000000 --- a/unicode/stemleaf/lib/get_x.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 copy = require( '@stdlib/utils/copy' ); - - -// MAIN // - -/** -* Returns first chart data. -* -* @private -* @returns {(Array|TypedArray)} first stem-and-leaf data -*/ -function getX() { - /* eslint-disable no-invalid-this */ - return copy( this._x ); -} - - -// EXPORTS // - -module.exports = getX; diff --git a/unicode/stemleaf/lib/get_xvalue.js b/unicode/stemleaf/lib/get_xvalue.js deleted file mode 100644 index 7ab27a4..0000000 --- a/unicode/stemleaf/lib/get_xvalue.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the x-value accessor. -* -* @private -* @returns {Function} x-value accessor -*/ -function getXValue() { - /* eslint-disable no-invalid-this */ - return this._xValue; -} - - -// EXPORTS // - -module.exports = getXValue; diff --git a/unicode/stemleaf/lib/get_y.js b/unicode/stemleaf/lib/get_y.js deleted file mode 100644 index 6de6964..0000000 --- a/unicode/stemleaf/lib/get_y.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 copy = require( '@stdlib/utils/copy' ); - - -// MAIN // - -/** -* Returns second chart data. -* -* @private -* @returns {(Array|TypedArray)} second stem-and-leaf data -*/ -function getY() { - /* eslint-disable no-invalid-this */ - return copy( this._y ); -} - - -// EXPORTS // - -module.exports = getY; diff --git a/unicode/stemleaf/lib/get_yvalue.js b/unicode/stemleaf/lib/get_yvalue.js deleted file mode 100644 index 6e9450c..0000000 --- a/unicode/stemleaf/lib/get_yvalue.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Returns the y-value accessor. -* -* @private -* @returns {Function} y-value accessor -*/ -function getYValue() { - /* eslint-disable no-invalid-this */ - return this._yValue; -} - - -// EXPORTS // - -module.exports = getYValue; diff --git a/unicode/stemleaf/lib/index.js b/unicode/stemleaf/lib/index.js deleted file mode 100644 index 6615ea9..0000000 --- a/unicode/stemleaf/lib/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* Stem-and-Leaf Plot. -* -* @module @stdlib/plot/unicode/stemleaf -* -* @example -* var StemLeaf = require( '@stdlib/plot/unicode/stemleaf' ); -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/unicode/stemleaf/lib/main.js b/unicode/stemleaf/lib/main.js deleted file mode 100644 index b749ef6..0000000 --- a/unicode/stemleaf/lib/main.js +++ /dev/null @@ -1,253 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 defineProperty = require( '@stdlib/utils/define-property' ); -var xValue = require( './x_value.js' ); -var yValue = require( './y_value.js' ); -var formatData = require( './format_data.js' ); -var validate = require( './validate.js' ); -var setXValue = require( './set_xvalue.js' ); -var getXValue = require( './get_xvalue.js' ); -var setYValue = require( './set_yvalue.js' ); -var getYValue = require( './get_yvalue.js' ); -var setX = require( './set_x.js' ); -var getX = require( './get_x.js' ); -var setY = require( './set_y.js' ); -var getY = require( './get_y.js' ); -var render = require( './render.js' ); - - -// MAIN // - -/** -* Creates a stem-and-leaf plot. -* -* @constructor -* @param {Options} [options] - steam-and-leaf options -* @param {(Array|TypedArray)} [options.x] - first input data -* @param {(Array|TypedArray)} [options.y] - second input data -* @param {Function} [options.xValue] - x-value accessor -* @param {Function} [options.yValue] - y-value accessor -* @param {PositiveInteger} [options.leafDigits=1] - number of digits to display as leafs -* @returns {StemLeaf} chart instance -*/ -function StemLeaf( options ) { - var opts; - var err; - if ( !(this instanceof StemLeaf) ) { - if ( arguments.length ) { - return new StemLeaf( options ); - } - return new StemLeaf(); - } - if ( arguments.length ) { - opts = options; - err = validate( opts ); - if ( err ) { - throw err; - } - } else { - opts = {}; - } - - defineProperty( this, '_x', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': [] - }); - defineProperty( this, '_xValue', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': xValue - }); - defineProperty( this, '_y', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': [] - }); - defineProperty( this, '_yValue', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': yValue - }); - defineProperty( this, '_leafDigits', { - 'configurable': false, - 'enumerable': false, - 'writable': true, - 'value': 1 - }); - - if ( opts.xValue !== void 0 ) { - this._xValue = opts.xValue; - } - if ( opts.yValue !== void 0 ) { - this._yValue = opts.yValue; - } - if ( opts.x !== void 0 ) { - this._x = formatData( opts.x, this._yValue ); - } - if ( opts.y !== void 0 ) { - this._y = formatData( opts.y, this._yValue ); - } - if ( opts.leafDigits !== void 0 ) { - this._leafDigits = opts.leafDigits; - } - return this; -} - -/** -* `x`-value accessor. -* -* @name xValue -* @memberof StemLeaf.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* function xValue( d ) { -* return d.y; -* } -* var chart = new StemLeaf(); -* chart.xValue = xValue; -* -* @example -* function xValue( d ) { -* return d.y; -* } -* var chart = new StemLeaf({ -* 'xValue': xValue -* }); -* var fcn = chart.xValue; -* var bool = ( fcn === xValue ); -* // returns true -*/ -defineProperty( StemLeaf.prototype, 'xValue', { - 'configurable': false, - 'enumerable': true, - 'set': setXValue, - 'get': getXValue -}); - -/** -* `y`-value accessor. -* -* @name yValue -* @memberof StemLeaf.prototype -* @type {Function} -* @throws {TypeError} must be a function -* -* @example -* function yValue( d ) { -* return d.y; -* } -* var chart = new StemLeaf(); -* chart.yValue = yValue; -* -* @example -* function yValue( d ) { -* return d.y; -* } -* var chart = new StemLeaf({ -* 'yValue': yValue -* }); -* var fcn = chart.yValue; -* var bool = ( fcn === yValue ); -* // returns true -*/ -defineProperty( StemLeaf.prototype, 'yValue', { - 'configurable': false, - 'enumerable': true, - 'set': setYValue, - 'get': getYValue -}); - -/** -* First stem-and-leaf data. -* -* @name x -* @memberof StemLeaf.prototype -* @type {(Array|TypedArray)} -* @throws {TypeError} must be an array or typed array -* -* @example -* var chart = new StemLeaf(); -* chart.x = [ 1.0, 0.0, 8.0, 2.0, 5.0 ]; -* -* @example -* var x = [ 1.0, 0.0, 9.0, 2.0, 5.0 ]; -* var chart = new StemLeaf({ -* 'x': x -* }); -* var d = chart.x; -* // returns [...] -*/ -defineProperty( StemLeaf.prototype, 'x', { - 'configurable': false, - 'enumerable': true, - 'set': setX, - 'get': getX -}); - -/** -* Second stem-and-leaf data. -* -* @name y -* @memberof StemLeaf.prototype -* @type {(Array|TypedArray)} -* @throws {TypeError} must be an array or typed array -* -* @example -* var chart = new StemLeaf(); -* chart.y = [ 1.0, 0.0, 8.0, 2.0, 5.0 ]; -* -* @example -* var y = [ 1.0, 0.0, 9.0, 2.0, 5.0 ]; -* var chart = new StemLeaf({ -* 'y': y -* }); -* var d = chart.y; -* // returns [...] -*/ -defineProperty( StemLeaf.prototype, 'y', { - 'configurable': false, - 'enumerable': true, - 'set': setY, - 'get': getY -}); - -/** -* Renders a stem-and-leaf plot. -* -* @memberof StemLeaf.prototype -* @function render -* @returns {string} rendered stem-and-leaf display -*/ -StemLeaf.prototype.render = render; - - -// EXPORTS // - -module.exports = StemLeaf; diff --git a/unicode/stemleaf/lib/render.js b/unicode/stemleaf/lib/render.js deleted file mode 100644 index 7bf0588..0000000 --- a/unicode/stemleaf/lib/render.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 floor = require( '@stdlib/math/base/special/floor' ); -var exp10 = require( '@stdlib/math/base/special/exp10' ); - - -// FUNCTIONS // - -/** -* Comparator function to sort numeric array in ascending order. -* -* @private -* @param {number} a - first number -* @param {number} b - second number -* @returns {number} a - b -* -* @example -* var arr = [ 3, 1, 2, 5, 4 ]; -* var sorted = arr.sort( ascending ); -* // returns [ 1, 2, 3, 4, 5 ] -*/ -function ascending( a, b ) { - return a - b; -} - -/** -* Comparator function to sort object data array in ascending order. -* -* @private -* @param {Object} a - first data object -* @param {Object} b - second data object -* @returns {number} a.val - b.val -* -* @example -* var arr = [ -* { 'val': 2, 'class': 'x' }, -* { 'val': 3, 'class': 'y' }, -* { 'val': 7, 'class': 'y' }, -* { 'val': 2, 'class': 'x' }, -* ]; -* var sorted = arr.sort( ascending2 ); -* // returns [...] -*/ -function ascending2( a, b ) { - return a.val - b.val; -} - -/** -* Generates a sequence of whitespace characters. -* -* @private -* @param {integer} n - number of characters -* @returns {string} sequence of whitespace characters -* -* @example -* var str = spaces( 3 ); -* // returns ' ' -*/ -function spaces( n ) { - return new Array( n ).join( ' ' ); -} - -/** -* Create string representation of stem-and-leaf plot for a single data vector. -* -* @private -* @param {(Array|TypedArray)} x - input data -* @param {PositiveInteger} interval - 10**leafDigits -* @returns {string} chart representation -*/ -function constructSingleDisplay( x, interval ) { - var stemWidth; - var leafWidth; - var lastStem; - var chrs; - var len; - var str; - var stm; - var lf; - var i; - var v; - var n; - - x.sort( ascending ); - - len = x.length; - stm = new Array( len ); - lf = new Array( len ); - stemWidth = 0; - leafWidth = 0; - - for ( i = 0; i < len; i++ ) { - stm[ i ] = floor( x[ i ] / interval ); - chrs = stm[ i ].toString().length; - if ( chrs > stemWidth ) { - stemWidth = chrs; - } - lf[ i ] = x[ i ] % interval; - chrs = lf[ i ].toString().length; - if ( chrs > leafWidth ) { - leafWidth = chrs; - } - } - - str = ''; - for ( i = 0; i < len; i++ ) { - while ( lastStem < stm[ i ] ) { - lastStem += 1; - str += '\n'; - n = lastStem.toString().length - 1; - str += ' ' + lastStem + spaces( stemWidth - n ); - str += ' | '; - } - if ( stm[ i ] !== lastStem ) { - str += '\n'; - v = stm[ i ].toString(); - n = v.length - 1; - str += ' ' + v + spaces( stemWidth - n ); - str += ' | '; - } - v = lf[ i ].toString(); - n = v.length; - str += v + spaces( leafWidth - n ) + ' '; - lastStem = stm[ i ]; - } - return str; -} - -/** -* Create string representation of stem-and-leaf plot for two data vectors. -* -* @private -* @param {(Array|TypedArray)} x - first input data -* @param {(Array|TypedArray)} y - second input data -* @param {PositiveInteger} interval - 10**leafDigits -* @returns {string} chart representation -*/ -function constructDoubleDisplay( x, y, interval ) { - var xLeafWidth; - var yLeafWidth; - var stemWidth; - var lastStem; - var nSpaces; - var lines; - var line; - var lmax; - var chrs; - var data; - var arr; - var lfs; - var len; - var stm; - var i; - var v; - var n; - - data = []; - for ( i = 0; i < x.length; i++ ) { - v = { - 'val': x[ i ], - 'class': 'x' - }; - data.push( v ); - } - for ( i = 0; i < y.length; i++ ) { - v = { - 'val': y[ i ], - 'class': 'y' - }; - data.push( v ); - } - len = data.length; - - data.sort( ascending2 ); - - stemWidth = 0; - xLeafWidth = 0; - yLeafWidth = 0; - - stm = new Array( len ); - lfs = new Array( len ); - for ( i = 0; i < len; i++ ) { - stm[ i ] = floor( data[ i ].val / interval ); - chrs = stm[ i ].toString().length; - if ( chrs > stemWidth ) { - stemWidth = chrs; - } - if ( data[i].class === 'x' ) { - lfs[ i ] = data[ i ].val % interval; - chrs = lfs[ i ].toString().length; - if ( chrs > xLeafWidth ) { - xLeafWidth = chrs; - } - } else if ( data[i].class === 'y' ) { - lfs[ i ] = data[ i ].val % interval; - chrs = lfs[ i ].toString().length; - if ( chrs > yLeafWidth ) { - yLeafWidth = chrs; - } - } - } - - lines = []; - line = ''; - for ( i = 0; i < len; i++ ) { - while ( lastStem < stm[ i ] ) { - lines.push( line ); - lastStem += 1; - n = lastStem.toString().length - 1; - line = '& | ' + spaces( stemWidth - n ) + lastStem + ' | '; - } - if ( stm[ i ] !== lastStem ) { - if ( line ) { - lines.push( line ); - } - v = stm[ i ].toString(); - n = v.length - 1; - line = '& | '; - line += spaces( stemWidth - n ) + v; - line += ' | '; - } - v = lfs[ i ].toString(); - n = v.length; - if ( data[i].class === 'x' ) { - line = v + spaces( xLeafWidth - n ) + ' ' + line; - } else if ( data[i].class === 'y' ) { - line = line + v + spaces( xLeafWidth - n ) + ' '; - } - lastStem = stm[ i ]; - } - - // Align lines... - lmax = 0; - for ( i = 0; i < lines.length; i++ ) { - v = lines[ i ].indexOf( '|' ); - if ( v > lmax ) { - lmax = v; - } - } - for ( i = 0; i < lines.length; i++ ) { - arr = lines[ i ].split( '&', 2 ); - nSpaces = lmax - arr[ 0 ].length; - arr[ 0 ] = spaces( nSpaces ) + arr[ 0 ]; - lines[ i ] = arr[ 0 ] + arr[ 1 ]; - } - - return lines.join( '\n' ); -} - - -// MAIN // - -/** -* Renders a chart. -* -* @private -* @returns {string} rendered chart -*/ -function render() { - /* eslint-disable no-invalid-this */ - var interval; - var digits; - var ret; - var x; - var y; - - x = this._x; - y = this._y; - - digits = this._leafDigits; - interval = exp10( digits ); - - if ( x.length && y.length ) { - ret = constructDoubleDisplay( x, y, interval ); - } else if ( x.length && !y.length ) { - ret = constructSingleDisplay( x, interval ); - } else if ( y.length && !x.length ) { - ret = constructSingleDisplay( y, interval ); - } - - ret += '\n\n'; - ret += 'Legend: '; - ret += '\n X | Y => ' + interval + ' * X + Y\n'; - return ret; -} - - -// EXPORTS // - -module.exports = render; diff --git a/unicode/stemleaf/lib/set_x.js b/unicode/stemleaf/lib/set_x.js deleted file mode 100644 index b144fb4..0000000 --- a/unicode/stemleaf/lib/set_x.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isTypedArray = require( '@stdlib/assert/is-typed-array' ); -var isArray = require( '@stdlib/assert/is-array' ); -var format = require( '@stdlib/string/format' ); -var formatData = require( './format_data.js' ); - - -// MAIN // - -/** -* Sets the first chart data. -* -* @private -* @param {(Array|TypedArray)} x - data -* @throws {TypeError} must be an array or typed array -*/ -function setX( x ) { - /* eslint-disable no-invalid-this */ - if ( - !isArray( x ) && - !isTypedArray( x ) - ) { - throw new TypeError( format( 'invalid assignment. Must be an array or typed array. Value: `%s`.', x ) ); - } - this._x = formatData( x, this._xValue ); -} - - -// EXPORTS // - -module.exports = setX; diff --git a/unicode/stemleaf/lib/set_xvalue.js b/unicode/stemleaf/lib/set_xvalue.js deleted file mode 100644 index f140e99..0000000 --- a/unicode/stemleaf/lib/set_xvalue.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Sets the x-value accessor. -* -* @private -* @param {Function} fcn - accessor function -* @throws {TypeError} must be a function -*/ -function setXValue( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'xValue', fcn ) ); - } - this._xValue = fcn; -} - - -// EXPORTS // - -module.exports = setXValue; diff --git a/unicode/stemleaf/lib/set_y.js b/unicode/stemleaf/lib/set_y.js deleted file mode 100644 index 56d84a0..0000000 --- a/unicode/stemleaf/lib/set_y.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isTypedArray = require( '@stdlib/assert/is-typed-array' ); -var isArray = require( '@stdlib/assert/is-array' ); -var format = require( '@stdlib/string/format' ); -var formatData = require( './format_data.js' ); - - -// MAIN // - -/** -* Sets the second chart data. -* -* @private -* @param {(Array|TypedArray)} y - data -* @throws {TypeError} must be an array or typed array -*/ -function setY( y ) { - /* eslint-disable no-invalid-this */ - if ( - !isArray( y ) && - !isTypedArray( y ) - ) { - throw new TypeError( format( 'invalid assignment. Must be an array or typed array. Value: `%s`.', y ) ); - } - this._y = formatData( y, this._yValue ); -} - - -// EXPORTS // - -module.exports = setY; diff --git a/unicode/stemleaf/lib/set_yvalue.js b/unicode/stemleaf/lib/set_yvalue.js deleted file mode 100644 index 3dba3a7..0000000 --- a/unicode/stemleaf/lib/set_yvalue.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isFunction = require( '@stdlib/assert/is-function' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Sets the y-value accessor. -* -* @private -* @param {Function} fcn - accessor function -* @throws {TypeError} must be a function -*/ -function setYValue( fcn ) { - /* eslint-disable no-invalid-this */ - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid assignment. `%s` must be a function. Value: `%s`.', 'yValue', fcn ) ); - } - this._yValue = fcn; -} - - -// EXPORTS // - -module.exports = setYValue; diff --git a/unicode/stemleaf/lib/validate.js b/unicode/stemleaf/lib/validate.js deleted file mode 100644 index a6f74b6..0000000 --- a/unicode/stemleaf/lib/validate.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 isObject = require( '@stdlib/assert/is-plain-object' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var isArray = require( '@stdlib/assert/is-array' ); -var isTypedArray = require( '@stdlib/assert/is-typed-array' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Validates function options. -* -* @private -* @param {Options} opts - function options -* @param {(Array|TypedArray)} [opts.x] - chart data -* @param {(Array|TypedArray)} [opts.y] - chart data -* @param {Function} [opts.xValue] - x-value accessor -* @param {Function} [opts.yValue] - y-value accessor -* @param {PositiveInteger} leafDigits - number of digits to display as leafs -* @returns {(Error|null)} error or null -* -* @example -* var opts = { -* 'x': [ 23, 11, 137, 58 ], -* 'y': [ 21, 11, 39, 80 ] -* }; -* var err = validate( opts ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts ) { - if ( !isObject( opts ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) ); - } - if ( hasOwnProp( opts, 'x' ) ) { - if ( !isArray( opts.x ) && !isTypedArray( opts.x ) ) { - return new TypeError( format( 'invalid option. `%s` option must be an array or typed array. Option: `%s`.', 'x', opts.x ) ); - } - } - if ( hasOwnProp( opts, 'xValue' ) ) { - if ( !isFunction( opts.xValue ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a function. Option: `%s`.', 'xValue', opts.xValue ) ); - } - } - if ( hasOwnProp( opts, 'y' ) ) { - if ( !isArray( opts.y ) && !isTypedArray( opts.y ) ) { - return new TypeError( format( 'invalid option. `%s` option must be an array or typed array. Option: `%s`.', 'y', opts.y ) ); - } - } - if ( hasOwnProp( opts, 'yValue' ) ) { - if ( !isFunction( opts.yValue ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a function. Option: `%s`.', 'yValue', opts.yValue ) ); - } - } - if ( hasOwnProp( opts, 'leafDigits' ) ) { - if ( !isPositiveInteger( opts.leafDigits ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'leafDigits', opts.leafDigits ) ); - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/unicode/stemleaf/lib/x_value.js b/unicode/stemleaf/lib/x_value.js deleted file mode 100644 index f0f2e93..0000000 --- a/unicode/stemleaf/lib/x_value.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* `x`-value accessor function. -* -* @private -* @param {number} x - input value -* @returns {number} input value -* -* @example -* var v = xValue( 5.0 ); -* // returns 5.0 -*/ -function xValue( x ) { - return x; -} - - -// EXPORTS // - -module.exports = xValue; diff --git a/unicode/stemleaf/lib/y_value.js b/unicode/stemleaf/lib/y_value.js deleted file mode 100644 index 3e407ad..0000000 --- a/unicode/stemleaf/lib/y_value.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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'; - -/** -* `y`-value accessor function. -* -* @private -* @param {number} y - input value -* @returns {number} input value -* -* @example -* var v = yValue( 5.0 ); -* // returns 5.0 -*/ -function yValue( y ) { - return y; -} - - -// EXPORTS // - -module.exports = yValue; diff --git a/unicode/stemleaf/package.json b/unicode/stemleaf/package.json deleted file mode 100644 index 00977d2..0000000 --- a/unicode/stemleaf/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@stdlib/plot/unicode/stemleaf", - "version": "0.0.0", - "description": "Create a Unicode stem-and-leaf chart.", - "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": { - "example": "./examples", - "lib": "./lib" - }, - "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", - "stem", - "leaf", - "chart", - "graph", - "data", - "visualize", - "viz", - "vis", - "unicode" - ] -}