Draw graphs with Path2D
output.mov
The included example renders a multi-series currency chart for USD to GBP, JPY, and EUR rates using Path2D.
-
src/init.luau
The library module. This is the file you use in your Roblox project. -
examples/assets/gui.rbxm
Roblox model file for trying the showcase UI in Studio. -
examples/example.luau
Demo runner for the showcase UI. It creates PathGraph controllers, renders the chart, handles replay, and drives the hover tooltip/highlight overlay. -
examples/data.luau
Static showcase data generated from USD exchange rates for GBP, JPY, and EUR.
PathGraph is distributed as a Wally package and as a plain Luau module.
To use it in a Roblox project:
- Install the package with Wally or copy
src/init.luauinto your game. - Place it somewhere your UI code can require it, such as
ReplicatedStorage. - Create a parent
GuiObjectfor the graph. - Create a PathGraph controller with a graph configuration.
- Call
SetDatawith an array of numbers. - Update the controller over time with
SetData,Add,Remove, orClear.
PathGraph is designed around updating existing instances.
For best results:
- Reuse controllers instead of recreating them during animation.
- Use
Addwhen appending values to an existing series. - Set
ExpectedPointCountwhen the final data size is known. - Set
MinValueandMaxValuewhen multiple graphs should share the same scale. - Keep point counts reasonable; PathGraph shards long datasets across multiple
Path2Dinstances when needed. - Destroy controllers when their parent UI is removed.
PathGraph targets Roblox Luau and Roblox UI code that can use Path2D.
The module can be installed through Wally, from the Creator Store, or copied directly into a Roblox project.
This project is licensed under the MIT License. See LICENSE for details.