{"id":13469882,"url":"https://github.com/plotly/react-pivottable","last_synced_at":"2026-01-12T05:37:02.539Z","repository":{"id":24325107,"uuid":"100298254","full_name":"plotly/react-pivottable","owner":"plotly","description":"React-based drag'n'drop pivot table with Plotly.js charts","archived":false,"fork":false,"pushed_at":"2025-01-27T14:19:45.000Z","size":644,"stargazers_count":1054,"open_issues_count":111,"forks_count":283,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-12-25T11:49:00.394Z","etag":null,"topics":["pivot-tables","react"],"latest_commit_sha":null,"homepage":"https://react-pivottable.js.org/","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/plotly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://plot.ly/products/consulting-and-oem/"}},"created_at":"2017-08-14T18:36:06.000Z","updated_at":"2025-12-17T08:01:14.000Z","dependencies_parsed_at":"2025-04-25T11:38:00.509Z","dependency_job_id":"20292d8c-fd35-4a5c-937e-a1ee233f295b","html_url":"https://github.com/plotly/react-pivottable","commit_stats":{"total_commits":101,"total_committers":11,"mean_commits":9.181818181818182,"dds":0.2376237623762376,"last_synced_commit":"4be236ec81ed276d9d8ab264d7c3c5912e1882bd"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/plotly/react-pivottable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Freact-pivottable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Freact-pivottable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Freact-pivottable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Freact-pivottable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plotly","download_url":"https://codeload.github.com/plotly/react-pivottable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Freact-pivottable/sbom","scorecard":{"id":738074,"data":{"date":"2025-08-11","repo":{"name":"github.com/plotly/react-pivottable","commit":"34dba0ec6a60ad1ac6ec577b02319c5df4dfa9ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"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":"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":"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":"Code-Review","score":2,"reason":"Found 4/20 approved changesets -- score normalized to 2","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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T16:30:04.582Z","repository_id":24325107,"created_at":"2025-08-22T16:30:04.583Z","updated_at":"2025-08-22T16:30:04.583Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["pivot-tables","react"],"created_at":"2024-07-31T16:00:18.321Z","updated_at":"2026-01-12T05:37:02.524Z","avatar_url":"https://github.com/plotly.png","language":"JavaScript","readme":"# react-pivottable\n\n`react-pivottable` is a React-based pivot table library with drag'n'drop\nfunctionality. It is a React port of the jQuery-based\n[PivotTable.js](https://pivottable.js.org/) by the same author.\n\n`react-pivottable` is part of Plotly's [React Component Suite](https://plot.ly/products/react/) for building data visualization Web apps and products.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://dash.plotly.com/project-maintenance\"\u003e\n    \u003cimg src=\"https://dash.plotly.com/assets/images/maintained-by-plotly.png\" width=\"400px\" alt=\"Maintained by Plotly\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## What does it do \u0026 where is the demo?\n\n`react-pivottable`'s function is to enable data exploration and analysis by\nsummarizing a data set into table or [Plotly.js](https://plot.ly/javascript/)\nchart with a true 2-d drag'n'drop UI, very similar to the one found in older\nversions of Microsoft Excel.\n\nA [live demo can be found here](https://react-pivottable.js.org/).\n\n![screencap](examples/basic.gif)\n\n## How can I use it in my project?\n\n### Drag'n'drop UI with Table output only\n\nInstallation is via NPM and has a peer dependency on React:\n\n```\nnpm install --save react-pivottable react react-dom\n```\n\nBasic usage is as follows. Note that `PivotTableUI` is a \"dumb component\" that\nmaintains essentially no state of its own.\n\n```js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PivotTableUI from 'react-pivottable/PivotTableUI';\nimport 'react-pivottable/pivottable.css';\n\n// see documentation for supported input formats\nconst data = [['attribute', 'attribute2'], ['value1', 'value2']];\n\nclass App extends React.Component {\n    constructor(props) {\n        super(props);\n        this.state = props;\n    }\n\n    render() {\n        return (\n            \u003cPivotTableUI\n                data={data}\n                onChange={s =\u003e this.setState(s)}\n                {...this.state}\n            /\u003e\n        );\n    }\n}\n\nReactDOM.render(\u003cApp /\u003e, document.body);\n```\n\n### Drag'n'drop UI with Plotly charts as well as Table output\n\nThe Plotly `react-plotly.js` component can be passed in via dependency\ninjection. It has a peer dependency on `plotly.js`.\n\n**Important:** If you build your project using webpack, you'll have to follow\n[these instructions](https://github.com/plotly/plotly.js#building-plotlyjs-with-webpack)\nin order to successfully bundle `plotly.js`. See below for how to avoid having\nto bundle `plotly.js`.\n\n```\nnpm install --save react-pivottable react-plotly.js plotly.js react react-dom\n```\n\nTo add the Plotly renderers to your app, you can use the following pattern:\n\n```js\nimport React from 'react';\nimport PivotTableUI from 'react-pivottable/PivotTableUI';\nimport 'react-pivottable/pivottable.css';\nimport TableRenderers from 'react-pivottable/TableRenderers';\nimport Plot from 'react-plotly.js';\nimport createPlotlyRenderers from 'react-pivottable/PlotlyRenderers';\n\n// create Plotly renderers via dependency injection\nconst PlotlyRenderers = createPlotlyRenderers(Plot);\n\n// see documentation for supported input formats\nconst data = [['attribute', 'attribute2'], ['value1', 'value2']];\n\nclass App extends React.Component {\n    constructor(props) {\n        super(props);\n        this.state = props;\n    }\n\n    render() {\n        return (\n            \u003cPivotTableUI\n                data={data}\n                onChange={s =\u003e this.setState(s)}\n                renderers={Object.assign({}, TableRenderers, PlotlyRenderers)}\n                {...this.state}\n            /\u003e\n        );\n    }\n}\n\nReactDOM.render(\u003cApp /\u003e, document.body);\n```\n\n#### With external `plotly.js`\n\nIf you would rather not install and bundle `plotly.js` but rather get it into\nyour app via something like `\u003cscript\u003e` tag, you can ignore `react-plotly.js`'\npeer-dependcy warning and handle the dependency injection like this:\n\n```js\nimport React from 'react';\nimport PivotTableUI from 'react-pivottable/PivotTableUI';\nimport 'react-pivottable/pivottable.css';\nimport TableRenderers from 'react-pivottable/TableRenderers';\nimport createPlotlyComponent from 'react-plotly.js/factory';\nimport createPlotlyRenderers from 'react-pivottable/PlotlyRenderers';\n\n// create Plotly React component via dependency injection\nconst Plot = createPlotlyComponent(window.Plotly);\n\n// create Plotly renderers via dependency injection\nconst PlotlyRenderers = createPlotlyRenderers(Plot);\n\n// see documentation for supported input formats\nconst data = [['attribute', 'attribute2'], ['value1', 'value2']];\n\nclass App extends React.Component {\n    constructor(props) {\n        super(props);\n        this.state = props;\n    }\n\n    render() {\n        return (\n            \u003cPivotTableUI\n                data={data}\n                onChange={s =\u003e this.setState(s)}\n                renderers={Object.assign({}, TableRenderers, PlotlyRenderers)}\n                {...this.state}\n            /\u003e\n        );\n    }\n}\n\nReactDOM.render(\u003cApp /\u003e, document.body);\n```\n\n## Properties and layered architecture\n\n* `\u003cPivotTableUI {...props} /\u003e`\n  * `\u003cPivotTable {...props} /\u003e`\n    * `\u003cRenderer {...props} /\u003e`\n      * `PivotData(props)`\n\nThe interactive component provided by `react-pivottable` is `PivotTableUI`, but\noutput rendering is delegated to the non-interactive `PivotTable` component,\nwhich accepts a subset of its properties. `PivotTable` can be invoked directly\nand is useful for outputting non-interactive saved snapshots of `PivotTableUI`\nconfigurations. `PivotTable` in turn delegates to a specific renderer component,\nsuch as the default `TableRenderer`, which accepts a subset of the same\nproperties. Finally, most renderers will create non-React `PivotData` object to\nhandle the actual computations, which also accepts a subset of the same props as\nthe rest of the stack.\n\nHere is a table of the properties accepted by this stack, including an\nindication of which layer consumes each, from the bottom up:\n\n| Layer          | Key \u0026 Type                                       | Default Value                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| -------------- | ------------------------------------------------ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `PivotData`    | `data` \u003cbr /\u003e see below for formats              | (none, required)              | data to be summarized                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| `PivotData`    | `rows` \u003cbr /\u003e array of strings                   | `[]`                          | attribute names to prepopulate in row area                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| `PivotData`    | `cols` \u003cbr /\u003e array of strings                   | `[]`                          | attribute names to prepopulate in cols area                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| `PivotData`    | `vals` \u003cbr /\u003e array of strings                   | `[]`                          | attribute names used as arguments to aggregator (gets passed to aggregator generating function)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| `PivotData`    | `aggregators` \u003cbr /\u003e object of functions         | `aggregators` from `Utilites` | dictionary of generators for aggregation functions in dropdown (see [original PivotTable.js documentation](https://github.com/nicolaskruchten/pivottable/wiki/Aggregators))                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| `PivotData`    | `aggregatorName` \u003cbr /\u003e string                   | first key in `aggregators`    | key to `aggregators` object specifying the aggregator to use for computations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| `PivotData`    | `valueFilter` \u003cbr /\u003e object of arrays of strings | `{}`                          | object whose keys are attribute names and values are objects of attribute value-boolean pairs which denote records to include or exclude from computation and rendering; used to prepopulate the filter menus that appear on double-click                                                                                                                                                                                                                                                                                                                                                                                              |\n| `PivotData`    | `sorters` \u003cbr /\u003e object or function              | `{}`                          | accessed or called with an attribute name and can return a [function which can be used as an argument to `array.sort`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) for output purposes. If no function is returned, the default sorting mechanism is a built-in \"natural sort\" implementation. Useful for sorting attributes like month names, see [original PivotTable.js example 1](http://nicolas.kruchten.com/pivottable/examples/mps_agg.html) and [original PivotTable.js example 2](http://nicolas.kruchten.com/pivottable/examples/montreal_2014.html). |\n| `PivotData`    | `rowOrder` \u003cbr /\u003e string                         | `\"key_a_to_z\"`                | the order in which row data is provided to the renderer, must be one of `\"key_a_to_z\"`, `\"value_a_to_z\"`, `\"value_z_to_a\"`, ordering by value orders by row total                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| `PivotData`    | `colOrder` \u003cbr /\u003e string                         | `\"key_a_to_z\"`                | the order in which column data is provided to the renderer, must be one of `\"key_a_to_z\"`, `\"value_a_to_z\"`, `\"value_z_to_a\"`, ordering by value orders by column total                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n| `PivotData`    | `derivedAttributes` \u003cbr /\u003e object of functions   | `{}`                          | defines derived attributes (see [original PivotTable.js documentation](https://github.com/nicolaskruchten/pivottable/wiki/Derived-Attributes))                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| `Renderer`     | `\u003cany\u003e`                                          | (none, optional)              | Renderers may accept any additional properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| `PivotTable`   | `renderers` \u003cbr /\u003e object of functions           | `TableRenderers`              | dictionary of renderer components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| `PivotTable`   | `rendererName` \u003cbr /\u003e string                     | first key in `renderers`      | key to `renderers` object specifying the renderer to use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| `PivotTableUI` | `onChange` \u003cbr /\u003e function                       | (none, required)              | function called every time anything changes in the UI, with the new value of the properties needed to render the new state. This function must be hooked into a state-management system in order for the \"dumb\" `PivotTableUI` component to work.                                                                                                                                                                                                                                                                                                                                                             |\n| `PivotTableUI` | `hiddenAttributes` \u003cbr /\u003e array of strings       | `[]`                          | contains attribute names to omit from the UI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| `PivotTableUI` | `hiddenFromAggregators` \u003cbr /\u003e array of strings  | `[]`                          | contains attribute names to omit from the aggregator arguments dropdowns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| `PivotTableUI` | `hiddenFromDragDrop` \u003cbr /\u003e array of strings     | `[]`                          | contains attribute names to omit from the drag'n'drop portion of the UI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n| `PivotTableUI` | `menuLimit` \u003cbr /\u003e integer                       | 500                           | maximum number of values to list in the double-click menu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| `PivotTableUI` | `unusedOrientationCutoff` \u003cbr /\u003e integer         | 85                            | If the attributes' names' combined length in characters exceeds this value then the unused attributes area will be shown vertically to the left of the UI instead of horizontally above it. `0` therefore means 'always vertical', and `Infinity` means 'always horizontal'.                                                                                                                                                                                                                                                                                                                                  |\n\n### Accepted formats for `data`\n\n#### Arrays of objects\n\nOne object per record, the object's keys are the attribute names.\n\n_Note_: missing attributes or attributes with a value of `null` are treated as\nif the value was the string `\"null\"`.\n\n```js\nconst data = [\n    {\n        attr1: 'value1_attr1',\n        attr2: 'value1_attr2',\n        //...\n    },\n    {\n        attr1: 'value2_attr1',\n        attr2: 'value2_attr2',\n        //...\n    },\n    //...\n];\n```\n\n#### Arrays of arrays\n\nOne sub-array per record, the first sub-array contains the attribute names. If\nsubsequent sub-arrays are shorter than the first one, the trailing values are\ntreated as if they contained the string value `\"null\"`. If subsequent sub-arrays\nare longer than the first one, excess values are ignored. This format is\ncompatible with the output of CSV parsing libraries like PapaParse.\n\n```js\nconst data = [\n    ['attr1', 'attr2'],\n    ['value1_attr1', 'value1_attr2'],\n    ['value2_attr1', 'value2_attr2'],\n    //...\n];\n```\n\n#### Functions that call back\n\nThe function will be called with a callback that takes an object as a parameter.\n\n_Note_: missing attributes or attributes with a value of `null` are treated as\nif the value was the string `\"null\"`.\n\n```js\nconst data = function(callback) {\n    callback({\n        \"attr1\": \"value1_attr1\",\n        \"attr2\": \"value1_attr2\",\n        //...\n    });\n    callback({\n        \"attr1\": \"value2_attr1\",\n        \"attr2\": \"value2_attr2\",\n        //...\n    };\n    //...\n};\n```\n","funding_links":["https://plot.ly/products/consulting-and-oem/"],"categories":["Pivot Table","JavaScript","Libraires"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotly%2Freact-pivottable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplotly%2Freact-pivottable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotly%2Freact-pivottable/lists"}