{"id":20350564,"url":"https://github.com/seniru/linegraph-tfm","last_synced_at":"2025-04-12T01:35:57.131Z","repository":{"id":111874325,"uuid":"204123327","full_name":"Seniru/LineGraph-TFM","owner":"Seniru","description":"Lite, Reusable and customizable line charts for Transformice","archived":false,"fork":false,"pushed_at":"2019-12-28T04:34:25.000Z","size":199,"stargazers_count":10,"open_issues_count":30,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T21:21:24.355Z","etag":null,"topics":["charts","customizable","library","linegraph-tfm","lite","transformice"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/Seniru.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":"2019-08-24T07:20:08.000Z","updated_at":"2023-08-25T17:27:39.000Z","dependencies_parsed_at":"2023-07-15T23:30:17.235Z","dependency_job_id":null,"html_url":"https://github.com/Seniru/LineGraph-TFM","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FLineGraph-TFM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FLineGraph-TFM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FLineGraph-TFM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FLineGraph-TFM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seniru","download_url":"https://codeload.github.com/Seniru/LineGraph-TFM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504748,"owners_count":21115201,"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","customizable","library","linegraph-tfm","lite","transformice"],"created_at":"2024-11-14T22:32:03.480Z","updated_at":"2025-04-12T01:35:57.125Z","avatar_url":"https://github.com/Seniru.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cp align='center'\u003e\n\t\u003cimg src='linechart.png'\u003e\n\u003c/p\u003e\n\u003cp align='center'\u003e \n Lite, Reusable and customizable line charts for Transformice!\n \u003cbr\u003e \n   \u003ca href='https://github.com/Seniru/LineGraph-TFM/actions'\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/workflow/status/Seniru/LineGraph-TFM/Build and Deploy?logo=github\u0026style=flat-square\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://www.codefactor.io/repository/github/seniru/linegraph-tfm\"\u003e\u003cimg alt=\"CodeFactor Grade\" src=\"https://img.shields.io/codefactor/grade/github/Seniru/LineGraph-TFM?logo=codefactor\u0026style=flat-square\"\u003e\u003c/a\u003e\n   \u003ca href='#contributors'\u003e\u003cimg src='https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square' alt='All Contributors'\u003e\u003c/a\u003e\n  \u003cimg alt=\"GitHub file size in bytes\" src=\"https://img.shields.io/github/size/Seniru/LineGraph-TFM/src/linegraph.min.lua?label=Code%20size%20%28min%29\u0026style=flat-square\"\u003e\n  \u003cimg alt=\"GitHub tag (latest SemVer)\" src=\"https://img.shields.io/github/v/tag/Seniru/LineGraph-TFM?sort=semver\u0026style=flat-square\"\u003e\n  \u003ca href='https://opensource.org/licenses/MIT'\u003e\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/Seniru/LineGraph-TFM?style=flat-square\"\u003e\u003c/a\u003e\u003cbr\u003e \n\u003c/p\u003e\n\n### Features\n- Reusable\n- Lightweight\n- Customizable\n- Real time!\n- Class based\n- Easy\n\n### What's new! :fireworks: :fireworks: :fireworks:\n\n- Now you can add multiple Series to the same graph. Check out the \n[documentation](https://github.com/Seniru/LineGraph-TFM/blob/master/documentation.md) for more information!\n### Usage\n```lua\n--insert the library code before the script\n--then call LineChart.init()\nLineChart.init()\n--then call LineChart(id, x, y, w, h) to create a new chart\nchart = LineChart(1, 200, 50, 400, 200)\n--create a new series to insert into the created chart.\nseries1 = Series({1,2,3}, {1,2,3}, \"series1\")\n--add it to the chart\nchart:addSeries(series1)\n--set the labels to display (optional)\nchart:showLabels()\n--display the chart\nchart:show()\n-- this should show a linear chart ...\n```\nCheck the [documentation](https://github.com/Seniru/LineGraph-TFM/blob/master/documentation.md) for more\n\n### Demos\n\n\n\u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=y\u0026space;=\u0026space;tan\\\u0026space;x\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?y\u0026space;=\u0026space;tan\\\u0026space;x\" title=\"y = tan\\ x\" /\u003e\u003c/a\u003e\n\n```lua\nLineChart.init() --initialzing\n\nx = range(-5, 5, 0.5)\ny = map(x, function(x) return math.tan(x) end)\n\nchart = LineChart(1, 200, 50, 400, 200) --instantiation\nseries1 = Series(x, y, \"y = tan x\", 0xFFCC00) -- creates a new series with yellowish-orange color\nchart:addSeries(series1)\nchart:setGraphColor(0xFFFFFF, 0xFFFFFF) --sets graph color to white\nchart:show() --display the chart\n\n```\n\u003cp align='center'\u003e\n\u003ca href=\"https://ibb.co/609mvks\"\u003e\u003cimg src=\"https://i.ibb.co/1GyLsk2/graph2.png\" alt=\"graph2\" border=\"0\" width=95% height=250\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003chr\u003e\n\n\u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=\\inline\u0026space;y\u0026space;=\u0026space;2x^2\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?\\inline\u0026space;y\u0026space;=\u0026space;2x^2\" title=\"y = 2x^2\" /\u003e\u003c/a\u003e\n\n```lua\nLineChart.init() --initializing\n\nx = range(-5, 5, 0.5)\ny = map(x, function(x) return 2 * x * x end)\n\nchart = LineChart(1, 200, 50, 400, 200) --instantiation\nchart:addSeries(Series(x, y, \"y = 2x^2\", 0xCC89FF)) --adds a new series with color purple\nchart:setGraphColor(0xFFFFFF, 0xFFFFFF) --sets graph color to white\nchart:show() --display the chart\n```\n\u003cp align='center'\u003e\u003cimg src='https://i.imgur.com/TulCY9W.png' width=95% height=250\u003e\u003c/p\u003e\n\u003chr\u003e\n\nReal time Graphs! \u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=\\inline\u0026space;sin(x)\u0026space;\\times\u0026space;x\u0026space;^2\u0026space;\\times\u0026space;tanh(x)\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?\\inline\u0026space;sin(x)\u0026space;\\times\u0026space;x\u0026space;^2\u0026space;\\times\u0026space;tanh(x)\" title=\"sin(x) \\times x ^2 \\times tanh(x)\" /\u003e\u003c/a\u003e\n```lua\nLineChart.init()\n\nchart = LineChart(1, 200, 50, 400, 200) --instantiation\nseries1 = Series({0}, {0}, \"Real time\", 0xDD32CC) --creates a new series\nchart:setGraphColor(0xFFFFFF, 0xFFFFFF) --sets graph color to white\nchart:addSeries(series1) --adds the new series\n\ncurrX = 0\n--the real time mageic is here!\nfunction eventLoop(l, r)\n\tlocal x = range(currX, currX + 10, 0.1) --creates the x coordinates\n\tlocal y = map(x, function(x) return  math.sin(x) * x * x * math.tanh(x) end ) --maps x values to the specified function\n\tseries1:setData(x, y) --set new data to the series\n\tchart:show() --displays it\n\tcurrX = currX + 0.5 --this cause x coordinate to move by 0.5 every 500ms\nend\n```\n\u003cp align='center'\u003e\n\t\u003cimg src='https://media.giphy.com/media/ZbSt4f4p32yU0est9S/giphy.gif' width=95% height=250\u003e\n\u003c/p\u003e\n\nMulti-Series Graphs! \n\n```lua\nLineChart.init()\n\nchart = LineChart(1, 200, 50, 400, 200) --creates the chart (container for the series)\nchart:setGraphColor(0xFFFFFF, 0xFFFFFF) --sets graph color to white\nxData = range(0, 20, 1)  --creates a list of numbers from 0 to 20\n\nseries1 = Series(xData, xData, \"linear\") --creates a linear series\nseries2 = Series(xData, map(xData, function(x) return math.cos(x) end), \"y = cos x\") --creates a series which maps 'y' values to the 'tan x' value\nseries3 = Series(xData, map(xData, function(x) return math.random(x) end), \"random\") --creates a series which maps 'y' values randomly to 'x'\n\n--add all the series\nchart:addSeries(series1)\nchart:addSeries(series2)\nchart:addSeries(series3)\n\nchart:showLabels() --show the labels\nchart:show() --show the plots!\n```\n\u003cp align='center'\u003e\n\t\u003cimg src='https://i.ibb.co/F7w6sFp/Capt32ure.png' width=95% height=250\u003e\n\u003c/p\u003e\n\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Seniru\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/34127015?v=4\" width=\"100px;\" alt=\"Seniru Pasan Indira\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSeniru Pasan Indira\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Seniru/LineGraph-TFM/commits?author=Seniru\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Seniru/LineGraph-TFM/commits?author=Seniru\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#design-Seniru\" title=\"Design\"\u003e🎨\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://bit.ly/laut-id\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/26045253?v=4\" width=\"100px;\" alt=\"Lautenschlager\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLautenschlager\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Seniru/LineGraph-TFM/commits?author=Lautenschlager-id\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\u003c!--stackedit_data:\neyJoaXN0b3J5IjpbMTA5ODM5NzldfQ==\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniru%2Flinegraph-tfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseniru%2Flinegraph-tfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniru%2Flinegraph-tfm/lists"}