{"id":13481255,"url":"https://github.com/shutterstock/rickshaw","last_synced_at":"2025-05-13T20:07:19.355Z","repository":{"id":44463207,"uuid":"2616595","full_name":"shutterstock/rickshaw","owner":"shutterstock","description":" JavaScript toolkit for creating interactive real-time graphs","archived":false,"fork":false,"pushed_at":"2025-01-17T01:12:28.000Z","size":2280,"stargazers_count":6531,"open_issues_count":201,"forks_count":937,"subscribers_count":216,"default_branch":"main","last_synced_at":"2025-05-06T01:55:20.588Z","etag":null,"topics":["charts","d3","graph","javascript","rickshaw","svg"],"latest_commit_sha":null,"homepage":"https://shutterstock.github.io/rickshaw","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/shutterstock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2011-10-20T22:02:37.000Z","updated_at":"2025-05-04T15:22:30.000Z","dependencies_parsed_at":"2022-09-10T22:31:57.505Z","dependency_job_id":"65b0461a-ffe0-4a42-9ef9-2ce185f21f10","html_url":"https://github.com/shutterstock/rickshaw","commit_stats":{"total_commits":422,"total_committers":100,"mean_commits":4.22,"dds":0.7464454976303317,"last_synced_commit":"10ed07db7fa03a3667a276d55514c999e8c9ab72"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2Frickshaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2Frickshaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2Frickshaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2Frickshaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shutterstock","download_url":"https://codeload.github.com/shutterstock/rickshaw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252606930,"owners_count":21775413,"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","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":["charts","d3","graph","javascript","rickshaw","svg"],"created_at":"2024-07-31T17:00:50.166Z","updated_at":"2025-05-06T01:55:25.503Z","avatar_url":"https://github.com/shutterstock.png","language":"JavaScript","readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][github-actions-image]][github-actions-url]\n[![Coverage Status][coverage-image]][coverage-url]\n\n# Rickshaw\n\nRickshaw is a JavaScript toolkit for creating interactive time series graphs, developed at [Shutterstock](http://www.shutterstock.com)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Install](#install)\n  - [Dependencies](#dependencies)\n- [Rickshaw.Graph](#rickshawgraph)\n      - [element](#element)\n      - [series](#series)\n      - [renderer](#renderer)\n      - [width](#width)\n      - [height](#height)\n      - [min](#min)\n      - [max](#max)\n      - [padding](#padding)\n      - [interpolation](#interpolation)\n      - [stack](#stack)\n  - [Methods](#methods)\n      - [render()](#render)\n      - [configure()](#configure)\n      - [onUpdate(f)](#onupdatef)\n- [Extensions](#extensions)\n- [Rickshaw.Color.Palette](#rickshawcolorpalette)\n    - [Color Schemes](#color-schemes)\n    - [Interpolation](#interpolation)\n- [Rickshaw and Cross-Browser Support](#rickshaw-and-cross-browser-support)\n- [Minification](#minification)\n- [Development](#development)\n- [Contributing](#contributing)\n- [Authors](#authors)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n## Getting Started\n\nGetting started with a simple graph is straightforward.  Here's the gist:\n\n```javascript\nvar graph = new Rickshaw.Graph( {\n  element: document.querySelector('#graph'),\n  series: [\n    {\n      color: 'steelblue',\n      data: [ { x: 0, y: 23}, { x: 1, y: 15 }, { x: 2, y: 79 } ]\n    }, {\n      color: 'lightblue',\n      data: [ { x: 0, y: 30}, { x: 1, y: 20 }, { x: 2, y: 64 } ]\n    }\n  ]\n} );\n\ngraph.render();\n```\nSee the [overview](https://shutterstock.github.io/rickshaw/), [tutorial](http://shutterstock.github.com/rickshaw/tutorial/introduction.html), and [examples](http://shutterstock.github.com/rickshaw/examples/) for more.\n\n## Install\n\nIn the browser, manually add `rickshaw.min.js` and `rickshaw.min.css` in the document head.\n\nAlternatively, you can install Rickshaw using [Bower](https://bower.io/) or [npm](https://npmjs.com).\n\n```sh\n# With bower\nbower install rickshaw\n# With npm\nnpm install --save rickshaw\n```\n\n### Dependencies\n\nRickshaw relies on the fantastic [D3 visualization library](http://mbostock.github.com/d3/) to do lots of the heavy lifting for stacking and rendering to SVG.\n\nSome extensions require [jQuery](http://jquery.com) and [jQuery UI](http://jqueryui.com), but for drawing some basic graphs you'll be okay without.\n\n\n## Rickshaw.Graph\n\nA Rickshaw graph.  Send an `element` reference, `series` data, and optionally other properties to the constructor before calling `render()` to point the graph.  A listing of properties follows.  Send these as arguments to the constructor, and optionally set them later on already-instantiated graphs with a call to `configure()`\n\n##### element\n\nA reference to an HTML element that should hold the graph.\n\n##### series\n\nArray of objects containing series data to plot.  Each object should contain `data` at a minimum, a sorted array of objects each with x and y properties.  Optionally send a `name` and `color` as well.  Some renderers and extensions may also support additional keys.\n\n##### renderer\n\nA string containing the name of the renderer to be used.  Options include `area`, `stack`, `bar`, `line`, and `scatterplot`.  Defaults to `line`. Also see the `multi` meta renderer in order to support different renderers per series.\n\n##### width\n\nWidth of the graph in pixels.  Falls back to the width of the `element`, or defaults to 400 if the element has no width.\n\n##### height\n\nHeight of the graph in pixels.  Falls back to the height of the `element`, or defaults to 250 if the element has no height.\n\n##### min\n\nLower value on the Y-axis, or `auto` for the lowest value in the series.  Defaults to 0.\n\n##### max\n\nHighest value on the Y-axis.  Defaults to the highest value in the series.\n\n##### padding\n\nAn object containing any of `top`, `right`, `bottom`, and `left` properties specifying a padding percentage around the extrema of the data in the graph.  Defaults to 0.01 on top for 1% padding, and 0 on other sides. Padding on the bottom only applies when the `yMin` is either negative or `auto`.\n\n##### interpolation\n\nLine smoothing / interpolation method (see [D3 docs](https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-line_interpolate)); notable options:\n\n  * `linear`: straight lines between points\n  * `step-after`: square steps from point to point\n  * `cardinal`: smooth curves via cardinal splines (default)\n  * `basis`: smooth curves via B-splines\n\n##### stack\n\nAllows you to specify whether series should be stacked while in the context of stacking renderers (area, bar, etc).  Defaults to `stack: 'true'`. To unstack, `unstack: 'true'`.\n\n### Methods\n\nOnce you have instantiated a graph, call methods below to get pixels on the screen, change configuration, and set callbacks.\n\n##### render()\n\nDraw or redraw the graph.\n\n##### configure()\n\nSet properties on an instantiated graph.  Specify any properties the constructor accepts, including `width` and `height` and `renderer`.  Call `render()` to redraw the graph and reflect newly-configured properties.\n\n##### onUpdate(f)\n\nAdd a callback to run when the graph is rendered\n\n\n## Extensions\n\nOnce you have a basic graph, extensions let you add functionality.  See the [overview](https://shutterstock.github.io/rickshaw/) and [examples](http://shutterstock.github.com/rickshaw/examples/) listing for more.\n\n* __Rickshaw.Graph.Legend__ - add a basic legend\n\n* __Rickshaw.Graph.HoverDetail__ - show details on hover\n\n* __Rickshaw.Graph.JSONP__ - get data via a JSONP request\n\n* __Rickshaw.Graph.Annotate__ - add x-axis annotations\n\n* __Rickshaw.Graph.RangeSlider__ - dynamically zoom on the x-axis with a slider\n\n* __Rickshaw.Graph.RangeSlider.Preview__ - pan and zoom via graphical preview of entire data set\n\n* __Rickshaw.Graph.Axis.Time__ - add an x-axis and grid lines with time labels\n\n* __Rickshaw.Graph.Axis.X__ - add an x-axis and grid lines with arbitrary labels\n\n* __Rickshaw.Graph.Axis.Y__ - add a y-axis and grid lines\n\n* __Rickshaw.Graph.Axis.Y.Scaled__ - add a y-axis with an alternate scale\n\n* __Rickshaw.Graph.Behavior.Series.Highlight__ - highlight series on legend hover\n\n* __Rickshaw.Graph.Behavior.Series.Order__ - reorder series in the stack with drag-and-drop\n\n* __Rickshaw.Graph.Behavior.Series.Toggle__ - toggle series on and off through the legend\n\n\n## Rickshaw.Color.Palette\n\nRickshaw comes with a few color schemes. Instantiate a palette and specify a scheme name, and then call color() on the palette to get each next color.\n\n```javascript\nvar palette = new Rickshaw.Color.Palette( { scheme: 'spectrum2001' } );\n\npalette.color() // =\u003e first color in the palette\npalette.color() // =\u003e next color in the palette...\n```\n\nOptionally, to palette.color() can take a numeric argument to specify which color from the palette should be used (zero-indexed).  This can be helpful when assigning a color to series of a plot with particular meaning:\n\n```javascript\nvar palette = new Rickshaw.Color.Palette( { scheme: 'colorwheel' } );\n\npalette.color(0) // =\u003e first color in the palette - red in this example\npalette.color(2) // =\u003e third color in the palette - light blue\n```\n\n#### Color Schemes\n\n  * classic9\n  * colorwheel\n  * cool\n  * munin\n  * spectrum14\n  * spectrum2000\n  * spectrum2001\n\n#### Interpolation\n\nFor graphs with more series than palettes have colors, specify an `interpolatedStopCount` to the palette constructor.\n\n## Rickshaw and Cross-Browser Support\n\nThis library works in modern browsers and Internet Explorer 9+.\n\nRickshaw relies on the HTMLElement#classList API, which isn't natively supported in Internet Explorer 9.  Rickshaw adds support by including a shim which implements the classList API by extending the HTMLElement prototype.  You can disable this behavior if you like, by setting `RICKSHAW_NO_COMPAT` to a true value before including the library.\n\n## Minification\n\nIf your project uses minification, you will need to give a hint to the minifier to leave variables named `$super` named `$super`.  For example, with uglify on the command line:\n\n```\n$ uglify-js --reserved-names \"$super\" rickshaw.js \u003e rickshaw.min.js\n```\n\nOr a sample configuration with `grunt-contrib-uglify`:\n\n```javascript\nuglify: {\n  options: {\n    mangle: { except: [\"$super\"] }\n  }\n}\n```\n\n## Development\n\nFor building, we use [Node](http://nodejs.org) and [npm](http://npmjs.org). Running `npm run build` or `make` should get you going with any luck.\n\nAfter doing a build you can run the tests with the command: `npm test`\n\nFor more available options see the [package.json](package.json) scripts section.\n\n\n## Contributing\n\nPull requests are always welcome!  Please follow a few guidelines:\n\n- Please don't include updated versions of `rickshaw.js` and `rickshaw.min.js`.  Just changes to the source files will suffice.\n- Add a unit test or two to cover the proposed changes\n- Do as the Romans do and stick with existing whitespace and formatting conventions (i.e., tabs instead of spaces, etc)\n- Consider adding a simple example under `examples/` that demonstrates any new functionality\n\nPlease note that all interactions with Shutterstock follow the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).\n\n## Authors\n\nThis library was developed by David Chester, Douglas Hunter, and Silas Sewell at [Shutterstock](http://www.shutterstock.com)\n\n\n## License\n\nCopyright (C) 2011-2024 by Shutterstock Images, LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[npm-image]: https://img.shields.io/npm/v/rickshaw.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/rickshaw\n[github-actions-image]: https://github.com/shutterstock/rickshaw/actions/workflows/ci.yaml/badge.svg\n[github-actions-url]: https://github.com/shutterstock/rickshaw/actions/workflows/ci.yaml\n[coverage-image]: https://coveralls.io/repos/github/shutterstock/rickshaw/badge.svg?branch=main\n[coverage-url]: https://coveralls.io/github/shutterstock/rickshaw\n","funding_links":[],"categories":["Projects","JavaScript","Uncategorized","Javascript","Data Visualization","javascript","Charts","Data Visualization [🔝](#readme)","数据可视化"],"sub_categories":["Uncategorized","Graphics","Runner","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshutterstock%2Frickshaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshutterstock%2Frickshaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshutterstock%2Frickshaw/lists"}