2D Graph Renderer


Go read all the way to the bottom for more information

Old

I made a graph renderer using Viewports.
I will soon be open-sourcing it!

https://youtu.be/Lj0HiqZl9e4


Graph

Soon open-sourced

Core Rendering

  • Line and smooth curve rendering
  • Deterministic, pooled rendering
  • Optional area fill with envelope support
  • Supports negative and positive data ranges

View & Zoom

  • Independent X/Y view ranges
  • Stretch-to-fit rendering (true data remapping)
  • Drag-to-zoom selection
  • View range control (SetViewRange, SetViewFromBounds)
  • Auto resize on viewport changes

Grid & Axes

  • Configurable grid for X and Y axes
  • Custom label formatters
  • Grid updates during zoom

Cursor & Inspection

  • Interactive cursor with multiple snap modes
  • Nearest-point and interpolated sampling
  • Optional tooltip with formatted values
  • Cursor follows line or mouse

Interaction

  • From/To range selector
  • Drag selection to zoom
  • Tweened transitions
  • Throttled updates

Architecture

  • Modular design (Renderer / Grid / Cursor / Selection)
  • Fully typed
  • Object pooling for lines, fillers, and UI elements
  • Cached bounds & optimized coordinate mapping

^ yes…

22 Likes

Great!

One thing that has poked my eye is background gradient behavior:
when you zoom in so max value on graph changes the gradient does not change.
Please take a look what I assume is expected:

  • the color should be same

5 Likes

Yeah, this is because of the gradient is on the viewport frame, totally fixable tho
I’ll make it a property

THANKS

3 Likes

Right, i understand why this happens, sorry for bringing this pain to your code base.
What i mean is : green color means “good” numbers.
And after zooming in user still sees green color on top so he might think that the numbers on top are “good” but actually they are not.

2 Likes

The current behavior comes from the gradient being applied in view space (Viewport/UI space), so when you zoom, the gradient stays fixed while the data remaps underneath it. that’s why the top still appears “green” even though the absolute values have changed

I’m reworking this so the gradient can be value-based instead so colors will be mapped to the actual data range, not the current zoom

I’ll expose this as a configurable property so both behaviors are supported

2 Likes

I’ve fixed it,

Graph.GradientMode:

"View" | "Absolute" | "Relative"

2 Likes

Wow this looks amazing. That UI is only something I can dream of designing. Can you plot equations? Like y = x, or y = x^2.

2 Likes

Yep, the graph itself works on points, so equations like y = x or y = x^2 are just generated by sampling a function over a range and feeding the points in

I can make a Plot function if you want

You can see “all” the properties at 0:30 in the video

1 Like

This 3D graph renderer looks awesome! Great job making it in Roblox! It is awesome!

2 Likes
What have you given us?
The power...
2 Likes

This looks insane I havn’t seen anything of this quality made before cant wait to have a play arround with it myself once its open sourced, great job

1 Like

I’ve been trying to add more types of graphs, like a pie chart and a clock chart
It should be pretty easy except that I work 54h a week right now

Update

I’ve decided to come back on this and do another rewrite. The new version will support more types of Charts.

I started by adding Pie charts
I need to add the border and everything else, but it looks like this




^ This is possible with the new "Envelope" feature.


Rebrand:

LuauChart

LOO-ow-chart (/ˈluː.aʊ.tʃɑːrt/)

Introducing LuauChart: The most versatile data visualization library for Roblox.


Will release sometime this month (probably).

1 Like

Pie charts Update

local Data = {
	{ Value = 30, Color = Color3.fromRGB(255, 95, 95), Border = {Thickness = 5, Color = Color3.fromRGB(255, 255, 255)}, Explosion = 15 },
	{ Value = 70, Color = Color3.fromRGB(50, 95, 255), Border = {Thickness = 2, Color = Color3.fromRGB(0, 255, 0)} }
}
PieChart.Cutout = .5
PieChart:SetSlices(Data)

Everything is in pixels except “Cutout” which is a ratio.


PieChart.Cutout = 0
1 Like

Delays

I might have to delay (again), this is due to me having to work on basically 2 games at once, and I have to rework everything from the previous graph version (Cursor, Grid, and Selection)

1 Like

That was 4 months ago, and I finally had time to basically rewrite the whole thing to use EditableImages instead and have a trillion customization options for any type of Chart

I’m adding this, and then I’ll make a showcase then Open source it

1 Like








–

EACH have a shit ton of customization

2 Likes

excuse me if this is offtopic but how do you change your default explorer icons to those, i’ve been seeing people have them and i really liked them, anywho this projects looks great & well made, good job

1 Like

I would use Claude to make a showcase place but I don’t want Anti-AI cry babies in the replies, what do I do?

And the docs cuz there’s like a trillion thinghs