Skip to content

Conversation

@divisio74
Copy link
Contributor

@divisio74 divisio74 commented Sep 23, 2025

Gno Scatterplot

New Pr for the gnov package with coding style correction and new README.md

The gnov package allows you to render a scatter plot as an SVG image. It takes a list of (x, y) points and draws them as circles on a 2D canvas. You can also apply optional flags to display regression lines or curves.

API references

Testscatter(POINTS, "TITLE", "X_AXIS_TITLE", "Y_AXIS_TITLE", "FLAG")

POINTS strcuture is set with the following arguments :

   type Point struct {
       X, Y  float64 //Coordinate of the point
       Color string // Color of the point
       Label string // Associate a label to the point
   }

TITLE, X_AXIS_TITLE, Y_AXIS_TITLE are strings.

FlagRe is a Boolean value: true to enable and false by default.

Maxticks is an int n used to divide the axis into n graduation marks.

Width and height are int to personalize the size of the scatterplot.

Usage

Usecase

ScatterPlot{
        Points: []Point{
            {X: 100, Y: 00, Label: "A"},
            {X: 101, Y: 20, Label: "B"},
            {X: 102, Y: 40, Label: "C"},
			{X: 103, Y: 60, Label: "D"},
        },
        Title: "Sales Growth",
        XAxis: "Years",
        YAxis: "Sales",
        FlagRe:  true,
        maxticks: 20,
        width: 800,
        height: 800,
    }

Flags

Lineary Regression flag that display the regression line of the scatterplot can be actived by the bool true.
Each flag shows the equation of the regression in the top left of the Scatterplot.

Example

image

@Davphla
Copy link

Davphla commented Sep 27, 2025

Hey, nice idea! 🥳
I recommend you to add images in your PR for visual examples.

@@ -0,0 +1,50 @@
# GNOV Scatterplot

The `gnov` package allows you to render a scatter plot as an SVG image. It takes a list of `(x, y)` points and draws them as circles on a 2D canvas. You can also apply optional flags to display regression lines or curves.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What means the name gnov?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gno Visual aha but i thinks we can find a better name for this ...

Copy link

@Davphla Davphla Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you keep the name (which I think is alright), I think it's always great to highlight what it means, so the reader can better remind of it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @Davphla said; rename the H1 to the full name, GnoVisual, so that it makes sense to the reader. Then, you can chose to abbreviate it if you want. I get the point of shortening names, but you should ty naming your packages so that they're recognizable from the import path. A good name would be 'p/pierre115/scatterplot` :)

Label string
}

// Scatterplot structure
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


`POINTS` strcuture is set with the following arguments :
```go
X, Y float64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the type point struct { here to make it easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its done !

@leohhhn
Copy link
Contributor

leohhhn commented Oct 2, 2025

Hey, can you please reply to @Davphla's comments before resolving the conversations?

@Davphla
Copy link

Davphla commented Oct 3, 2025

@divisio74 I recommend you to add the link to the commit when replying to the comment!

Copy link

@Davphla Davphla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall some missing details, but after it's fixed it should be good I think!

@Davphla
Copy link

Davphla commented Oct 3, 2025

Also CI don't pass

@leohhhn
Copy link
Contributor

leohhhn commented Oct 6, 2025

you can run make fmt in the packages/ folder to fix the CI :)

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some preliminary comments

@@ -0,0 +1,50 @@
# GNOV Scatterplot

The `gnov` package allows you to render a scatter plot as an SVG image. It takes a list of `(x, y)` points and draws them as circles on a 2D canvas. You can also apply optional flags to display regression lines or curves.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @Davphla said; rename the H1 to the full name, GnoVisual, so that it makes sense to the reader. Then, you can chose to abbreviate it if you want. I get the point of shortening names, but you should ty naming your packages so that they're recognizable from the import path. A good name would be 'p/pierre115/scatterplot` :)

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check out a few more comments by me and @Davphla so we can go ahead with the merge?

@leohhhn
Copy link
Contributor

leohhhn commented Nov 10, 2025

Can you check why the lint CI is failing? all good, staging was reloading

@leohhhn leohhhn merged commit 9b50eb2 into gnoverse:main Nov 10, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants