在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:shutterstock/rickshaw开源软件地址:https://github.com/shutterstock/rickshaw开源编程语言:JavaScript 87.2%开源软件介绍:RickshawRickshaw is a JavaScript toolkit for creating interactive time series graphs, developed at Shutterstock Table of Contents
Getting StartedGetting started with a simple graph is straightforward. Here's the gist: var graph = new Rickshaw.Graph( {
element: document.querySelector('#graph'),
series: [
{
color: 'steelblue',
data: [ { x: 0, y: 23}, { x: 1, y: 15 }, { x: 2, y: 79 } ]
}, {
color: 'lightblue',
data: [ { x: 0, y: 30}, { x: 1, y: 20 }, { x: 2, y: 64 } ]
}
]
} );
graph.render(); See the overview, tutorial, and examples for more. InstallIn the browser, manually add Alternatively, you can install Rickshaw using Bower or npm. # With bower
bower install rickshaw
# With npm
npm install --save rickshaw DependenciesRickshaw relies on the fantastic D3 visualization library to do lots of the heavy lifting for stacking and rendering to SVG. Some extensions require jQuery and jQuery UI, but for drawing some basic graphs you'll be okay without. Rickshaw uses jsdom to run unit tests in Node to be able to do SVG manipulation. As of the jsdom 7.0.0 release, jsdom requires Node.js 4 or newer jsdom changelog. If you want to run the tests on your machine, and you don't have access to a version of node >= 4.0, you can Rickshaw.GraphA Rickshaw graph. Send an elementA reference to an HTML element that should hold the graph. seriesArray of objects containing series data to plot. Each object should contain rendererA string containing the name of the renderer to be used. Options include widthWidth of the graph in pixels. Falls back to the width of the heightHeight of the graph in pixels. Falls back to the height of the minLower value on the Y-axis, or maxHighest value on the Y-axis. Defaults to the highest value in the series. paddingAn object containing any of interpolationLine smoothing / interpolation method (see D3 docs); notable options:
stackAllows you to specify whether series should be stacked while in the context of stacking renderers (area, bar, etc). Defaults to MethodsOnce you have instantiated a graph, call methods below to get pixels on the screen, change configuration, and set callbacks. render()Draw or redraw the graph. configure()Set properties on an instantiated graph. Specify any properties the constructor accepts, including onUpdate(f)Add a callback to run when the graph is rendered ExtensionsOnce you have a basic graph, extensions let you add functionality. See the overview and examples listing for more.
Rickshaw.Color.PaletteRickshaw 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. var palette = new Rickshaw.Color.Palette( { scheme: 'spectrum2001' } );
palette.color() // => first color in the palette
palette.color() // => next color in the palette... Optionally, 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: var palette = new Rickshaw.Color.Palette( { scheme: 'colorwheel' } );
palette.color(0) // => first color in the palette - red in this example
palette.color(2) // => third color in the palette - light blue Color Schemes
InterpolationFor graphs with more series than palettes have colors, specify an Rickshaw and Cross-Browser SupportThis library works in modern browsers and Internet Explorer 9+. Rickshaw 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 MinificationIf your project uses minification, you will need to give a hint to the minifier to leave variables named
Or a sample configuration with uglify: {
options: {
mangle: { except: ["$super"] }
}
} DevelopmentFor building, we use Node and npm. Running After doing a build you can run the tests with the command: For more availible options see the package.json scripts section. ContributingPull requests are always welcome! Please follow a few guidelines:
Please note that all interactions with Shutterstock follow the Contributor Covenant Code of Conduct. AuthorsThis library was developed by David Chester, Douglas Hunter, and Silas Sewell at Shutterstock LicenseCopyright (C) 2011-2020 by Shutterstock Images, LLC Permission 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE 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. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论