{"id":15355816,"url":"https://github.com/fibo/olap-cube","last_synced_at":"2025-10-07T02:53:51.965Z","repository":{"id":57314102,"uuid":"60833547","full_name":"fibo/OLAP-cube","owner":"fibo","description":"is an hypercube of data","archived":false,"fork":false,"pushed_at":"2021-09-29T11:12:53.000Z","size":82,"stargazers_count":34,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-29T05:56:46.456Z","etag":null,"topics":["business-intelligence","cube","data-warehouse","data-warehousing","dwh","olap","olap-cube","pivot","pivot-tables","report","table"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["fibo"],"patreon":"fibo"}},"created_at":"2016-06-10T08:19:38.000Z","updated_at":"2025-07-17T05:15:40.000Z","dependencies_parsed_at":"2022-09-20T23:21:46.539Z","dependency_job_id":null,"html_url":"https://github.com/fibo/OLAP-cube","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fibo/OLAP-cube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2FOLAP-cube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2FOLAP-cube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2FOLAP-cube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2FOLAP-cube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibo","download_url":"https://codeload.github.com/fibo/OLAP-cube/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2FOLAP-cube/sbom","scorecard":{"id":398916,"data":{"date":"2025-08-11","repo":{"name":"github.com/fibo/OLAP-cube","commit":"10d107b3598cec643782393627cff80cdec356c0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T19:40:16.752Z","repository_id":57314102,"created_at":"2025-08-18T19:40:16.753Z","updated_at":"2025-08-18T19:40:16.753Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278712454,"owners_count":26032738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["business-intelligence","cube","data-warehouse","data-warehousing","dwh","olap","olap-cube","pivot","pivot-tables","report","table"],"created_at":"2024-10-01T12:25:44.327Z","updated_at":"2025-10-07T02:53:51.951Z","avatar_url":"https://github.com/fibo.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fibo","https://patreon.com/fibo"],"categories":[],"sub_categories":[],"readme":"# OLAP-cube\n\n\u003e is an hypercube of data\n\n[Description](#description) |\n[Installation](#installation) |\n[API](#api) |\n[License](#license)\n\n[![NPM version](https://badge.fury.io/js/olap-cube.svg)](http://badge.fury.io/js/olap-cube)\n[![Build Status](https://travis-ci.org/fibo/OLAP-cube.svg?branch=master)](https://travis-ci.org/fibo/OLAP-cube?branch=master)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Description\n\nAn [OLAP cube][OLAP_cube] is a multidimensional array of data you can\nexplore and analyze. Here you will find an engine that could feed a graphic viewer.\n\n## Installation\n\n### Using npm\n\nWith [npm] do\n\n```bash\nnpm install olap-cube\n```\n\n### Using a CDN\n\nAdd this to your HTML page\n\n```html\n\u003cscript src=\"https://unpkg.com/olap-cube/dist/olap-cube.min.js\"\u003e\u003c/script\u003e\n```\n\n## API\n\nAll code in this section is run and tested in [this single file][test_api].\nNote also that\n\n1. Everything is immutable, all attributes are static.\n2. Operators are chainable and they always return a brand new instance.\n\n### `new Table({ dimensions, fields, points, data })`\n\n* **@param** `{Object}` *arg*\n* **@param** `{Array}` *arg.dimensions*\n* **@param** `{Array}` *arg.points*\n* **@param** `{Array}` *arg.fields*\n* **@param** `{Array}` *arg.data* in the format data[pointIndex][fieldIndex]\n\n```javascript\nconst Table = require('olap-cube').model.Table\n\nconst table = new Table({\n  dimensions: ['year', 'month'],\n  fields: ['revenue'],\n  points: [[2016, 'Jan']],\n  data: [[100]]\n})\n\nconsole.log(table) // Table {\n                   //   dimensions: ['year', 'month'],\n                   //   fields: ['revenue']\n                   // }\n```\n\n### `table.structure`\n\n\u003e Attribute *structure* holds necessary information to clone a table excluding its data.\n\nCreate an empty table\n\n```javascript\nconst emptyTable = new Table(table.structure)\n```\n\n### `table.dimensions`\n\n\u003e The (hyper)cube dimensions.\n\nOne common dimension in [Business Intelligence][Business_intelligence]\nis **time**: it can have different granularities, like *year*, *month*, *day*, etc.\n\n```javascript\nconsole.log(table.dimensions) // [ 'year', 'month' ]\n```\n\n### `table.fields`\n\n\u003e The names of the data *fields*.\n\n```javascript\nconsole.log(table.fields) // [ 'revenue' ]\n```\n\n### `table.header`\n\n\u003e Attribute *header* concatenates dimension names and field names.\n\n```javascript\nconsole.log(table.header) // ['year', 'month', 'revenue']\n```\n\n### `table.addRows({ header: [key1, key2, ...], rows: [row1, row2, ...]})`\n\n\u003e Add a set of rows to the table.\n\n* **@param** `{Object}` *data*\n* **@param** `{Array}` *data.header*\n* **@param** `{Array}` *data.rows*\n* **@returns** `{Object}` *table*\n\nEvery row is an object which attributes are either a dimension or a field.\n\n```javascript\nconst table2 = emptyTable.addRows({\n  header: ['year', 'month', 'revenue'],\n  rows: [\n    [ 2015, 'Nov', 80 ],\n    [ 2015, 'Dec', 90 ],\n    [ 2016, 'Jan', 100 ],\n    [ 2016, 'Feb', 170 ],\n    [ 2016, 'Mar', 280 ],\n    [ 2017, 'Feb', 177 ],\n    [ 2017, 'Apr', 410 ]\n  ]\n})\n```\n\n### `table.data`\n\n\u003e Attribute *data* holds the facts of the table.\n\n```javascript\nconsole.log(table2.data) // [[ 80 ],\n                         //  [ 90 ],\n                         //  [ 100 ],\n                         //  [ 170 ],\n                         //  [ 280 ],\n                         //  [ 177 ],\n                         //  [ 410 ]]\n```\n\n### `table.rows`\n\n\u003e Attribute *rows* holds the dimensions and the facts of the table.\n\n```javascript\nconsole.log(table2.rows) // [[ 2015, 'Nov', 80 ],\n                         //  [ 2015, 'Dec', 90 ],\n                         //  [ 2016, 'Jan', 100 ],\n                         //  [ 2016, 'Feb', 170 ],\n                         //  [ 2016, 'Mar', 280 ],\n                         //  [ 2017, 'Feb', 177 ],\n                         //  [ 2017, 'Apr', 410 ]]\n```\n\n### `table.points`\n\n\u003e The *points* are an ordered set of coordinates.\n\nIn this case you can see 6 points with coordinates:\n\n1. year\n2. month\n\n```javascript\nconsole.log(table2.points) // [[ 2015, 'Nov' ],\n                           //  [ 2015, 'Dec' ],\n                           //  [ 2016, 'Jan' ],\n                           //  [ 2016, 'Feb' ],\n                           //  [ 2016, 'Feb' ],\n                           //  [ 2017, 'Apr' ]]\n```\n\n### `table.slice(dimension, filter)`\n\n\u003e Slice operator picks a rectangular subset of a cube by choosing a single value of its dimensions.\n\n* **@param** `{String}` *dimension*\n* **@param** `{*}` *filter*\n* **@returns** `{Object}` *table*\n\nConsider the following example, where a slice with 2016 year is created.\n\n```javascript\nconst table3 = table2.slice('year', 2016)\n\nconsole.log(table3.points) // [[ 2016, 'Jan' ],\n                           //  [ 2016, 'Feb' ],\n                           //  [ 2016, 'Mar' ]]\n\nconsole.log(table3.data) // [[ 100 ],\n                         //  [ 170 ],\n                         //  [ 280 ]]\n```\n\n### `table.dice(selector)`\n\n\u003e Dice operator picks a subcube by choosing a specific values of multiple dimensions.\n\n* **@param** `{Function}` *selector*\n* **@returns** `{Object}` *table*\n\nConsider the following example, where a dice excluding one month is created.\n\n```javascript\nconst onlyFebruary = (point) =\u003e point[1] !== 'Feb'\n\nconst table4 = table2.dice(onlyFebruary)\n\nconsole.log(table4.points) // [[ 2015, 'Nov' ],\n                           //  [ 2015, 'Dec' ],\n                           //  [ 2016, 'Jan' ],\n                           //  [ 2016, 'Mar' ],\n                           //  [ 2017, 'Apr' ]]\n\nconsole.log(table4.data) // [[ 80 ],\n                         //  [ 90 ],\n                         //  [ 100 ],\n                         //  [ 280 ],\n                         //  [ 410 ]]\n```\n\n### `table.rollup(dimension, fields, aggregator, initialValue)`\n\n\u003e A roll-up involves summarizing the data along a dimension. The summarization rule might be computing totals along a hierarchy or applying a set of formulas such as \"profit = sales - expenses\".\n\n* **@param** `{String}` *dimension*\n* **@param** `{Array}` *fields*\n* **@param** `{Function}` *aggregator*\n* **@param** `{*}` *initialValue* that will be passed to Array.prototype.reduce().\n* **@returns** `{Object}` *table*\n\n```javascript\nconst table5 = new Table({\n  dimensions: ['continent', 'country'],\n  fields: ['numStores']\n})\n\n// NOTA BENE: Remember that tables are immuTables ☺.\nconst table6 = table5.addRows({\n  header: [ 'continent', 'country', 'numStores' ],\n  rows: [\n    [ 'Europe', 'Norway', 20 ],\n    [ 'Europe', 'Denmark', 48 ],\n    [ 'Europe', 'Germany', 110 ],\n    [ 'Europe', 'Portugal', 17 ],\n    [ 'Asia', 'China', 280 ],\n    [ 'Asia', 'Russia', 161 ],\n    [ 'Asia', 'Thailand', 120 ]\n  ]\n})\n\n// Input tables and rolled up table has only one field,\n// with the same name: numStores.\n// Actually the aggregator is a reducer that will receive in input an\n// array of fields from the input table, and will output an array of\n// fields to the rolled up table.\nconst summation = (sum, value) =\u003e {\n  return [sum[0] + value[0]]\n}\n\nconst initialValue = [0]\n\nconst table7 = table6.rollup('continent', ['numStores'], summation, initialValue)\n\nconsole.log(table7.rows) // [[ 'Europe', 195 ],\n                         //  [ 'Asia', 561 ]]\n```\n\n## License\n\n[MIT](http://g14n.info/mit-license)\n\n[OLAP_cube]: https://en.wikipedia.org/wiki/OLAP_cube \"OLAP cube\"\n[npm]: https://npmjs.com \"npm\"\n[test_api]: https://github.com/fibo/OLAP-cube/blob/master/test/readme/api.js \"test API\"\n[Business_intelligence]: https://en.wikipedia.org/wiki/Business_intelligence \"Business Intellicence\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Folap-cube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibo%2Folap-cube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Folap-cube/lists"}