https://github.com/wwwtyro/candygraph Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} wwwtyro / candygraph * Notifications * Star 89 * Fork 0 Fast by default, flexible 2D plotting library. Unlicense License 89 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Clone HTTPS GitHub CLI [https://github.com/w] Use Git or checkout with SVN using the web URL. [gh repo clone wwwtyr] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @wwwtyro wwwtyro update packages and bump version ... 30011e7 May 23, 2021 update packages and bump version 30011e7 Git stats * 19 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time docs update packages and bump version May 23, 2021 media initial Jul 19, 2020 src Polar coordinate system May 22, 2021 .eslintrc.js initial Jul 19, 2020 .gitignore initial Jul 19, 2020 .npmignore initial Jul 19, 2020 LICENSE initial Jul 19, 2020 README.md Update README.md Jul 19, 2020 package-lock.json update packages and bump version May 23, 2021 package.json update packages and bump version May 23, 2021 tsconfig.json initial Jul 19, 2020 webpack.config.js initial Jul 19, 2020 View code CandyGraph Tutorial | Examples | API Docs Example README.md CandyGraph A flexible and fast-by-default 2D plotting library tuned for rendering huge datasets on the GPU at interactive speeds. Tutorial | Examples | API Docs * Adopts D3's elegant concept of scales, but implements them on the GPU to maximize data throughput and handle scale changes with no additional cost. * Performs all rendering on the GPU, even axes and text. This keeps rendering and compositing fast and simple - no need to overlay a canvas or svg over your plot. * Provides a small but growing set of highly optimized primitives that are tuned for handling huge datasets. * Provides a set of higher-level composite objects composed of primitives to simplify common rendering tasks. CandyGraph is still in major version zero; the API should be considered unstable. Example [simple-plo] import { CandyGraph } from "candygraph"; async function main() { const cg = new CandyGraph(); cg.canvas.width = cg.canvas.height = 384; // Generate some x & y data. const xs = []; const ys = []; for (let x = 0; x <= 1; x += 0.001) { xs.push(x); ys.push(0.5 + 0.25 * Math.sin(x * 2 * Math.PI)); } // Create a viewport. Units are in pixels. const viewport = { x: 0, y: 0, width: cg.canvas.width, height: cg.canvas.height, }; // Create a coordinate system from two linear scales. Note // that we add 32 pixels of padding to the left and bottom // of the viewport, and 16 pixels to the top and right. const coords = cg.coordinate.cartesian( cg.scale.linear([0, 1], [32, viewport.width - 16]), cg.scale.linear([0, 1], [32, viewport.height - 16]) ); const font = await cg.defaultFont; // Clear the viewport. cg.clear([1, 1, 1, 1]); // Render the a line strip representing the x & y data, and axes. cg.render(coords, viewport, [ cg.lineStrip(xs, ys, { colors: [1, 0.5, 0.0, 1.0], widths: 3, }), cg.orthoAxis(coords, "x", font, { labelSide: 1, tickOffset: -2.5, tickLength: 6, tickStep: 0.2, labelFormatter: (n) => n.toFixed(1), }), cg.orthoAxis(coords, "y", font, { tickOffset: 2.5, tickLength: 6, tickStep: 0.2, labelFormatter: (n) => n.toFixed(1), }), ]); // Copy the plot to a new canvas and add it to the document. document.body.appendChild(cg.copyTo(viewport)); } main(); About Fast by default, flexible 2D plotting library. Resources Readme License Unlicense License Releases No releases published Packages 0 No packages published Languages * TypeScript 98.8% * JavaScript 1.2% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.