{"id":20565839,"url":"https://github.com/phenax/graph-plotting","last_synced_at":"2025-06-20T12:06:11.270Z","repository":{"id":83227600,"uuid":"76160482","full_name":"phenax/graph-plotting","owner":"phenax","description":"Javascript library that lets you plot points and lines based on the Cartesian system with a very simple api, on an html5 canvas.","archived":false,"fork":false,"pushed_at":"2018-04-28T14:30:05.000Z","size":28,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T19:52:33.231Z","etag":null,"topics":["canvas","graph","javascript-library","plot"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phenax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2016-12-11T07:29:52.000Z","updated_at":"2016-12-11T07:38:20.000Z","dependencies_parsed_at":"2023-06-29T00:30:15.037Z","dependency_job_id":null,"html_url":"https://github.com/phenax/graph-plotting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fgraph-plotting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fgraph-plotting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fgraph-plotting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenax%2Fgraph-plotting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenax","download_url":"https://codeload.github.com/phenax/graph-plotting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242179252,"owners_count":20084940,"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":["canvas","graph","javascript-library","plot"],"created_at":"2024-11-16T04:39:16.878Z","updated_at":"2025-03-06T08:44:42.859Z","avatar_url":"https://github.com/phenax.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph\n[![Build Status](https://travis-ci.org/phenax/graph-plotting.svg?branch=master)](https://travis-ci.org/phenax/graph-plotting)\n\nJavascript library that lets you plot points and lines based on the Cartesian system with a very simple api, on an html5 canvas.\n\n[Preview](http://htmlpreview.github.io/?https://github.com/phenax/graph-plotting/blob/master/index.html)\n\n\n### API\n\n* Create the graph\n```javascript\n  const ctx= canvas.getContext('2d');\n\n  const graph= new Graph({\n    context: ctx,\n    labels: {\n      x: 'foo',\n      y: 'bar'\n    },\n    dimens: {\n      width: $canvas.width,\n      height: $canvas.height,\n    }\n  });\n```\n\n* Set the axes for the graph(This will also determine the scale for the graph)\n```javascript\n\n  graph\n    .setAxisX([-100, 100])\n    .setAxisY([-100, 100]);\n\n```\n\n* Plot a point on the graph\n```javascript\n  graph.plot(x, y);\n```\n\n* Plot a line\n\n  - Standard form\n    ```javascript\n      graph.plotLine({ 'standard': { m: 1, c: 20 }});\n    ```\n\n  - 2 Point form\n    ```javascript\n      graph.plotLine({ '2 points': [ [ 0, 0 ], [ 2, 1 ] ]});\n    ```\n\n* Show the graph\n```javascript\n  graph.show();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenax%2Fgraph-plotting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenax%2Fgraph-plotting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenax%2Fgraph-plotting/lists"}