Skip to content

w1nthinker/path-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PathGraph

Draw graphs with Path2D

Installation

install with wally

get from creator store

edit showcase game

Examples

play showcase game

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.

Getting Started

PathGraph is distributed as a Wally package and as a plain Luau module.

To use it in a Roblox project:

  1. Install the package with Wally or copy src/init.luau into your game.
  2. Place it somewhere your UI code can require it, such as ReplicatedStorage.
  3. Create a parent GuiObject for the graph.
  4. Create a PathGraph controller with a graph configuration.
  5. Call SetData with an array of numbers.
  6. Update the controller over time with SetData, Add, Remove, or Clear.

Performance Notes

PathGraph is designed around updating existing instances.

For best results:

  • Reuse controllers instead of recreating them during animation.
  • Use Add when appending values to an existing series.
  • Set ExpectedPointCount when the final data size is known.
  • Set MinValue and MaxValue when multiple graphs should share the same scale.
  • Keep point counts reasonable; PathGraph shards long datasets across multiple Path2D instances when needed.
  • Destroy controllers when their parent UI is removed.

Requirements

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.

License

This project is licensed under the MIT License. See LICENSE for details.

About

draw graphs with Path2D's

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages