From 48476dde695f4a010979dba78a61466d2de38bec Mon Sep 17 00:00:00 2001 From: That_One_Nerd Date: Tue, 27 Feb 2024 15:49:25 -0500 Subject: [PATCH] Version 1.0 is ready to be published. --- .gitignore | 4 ++ Base/Base.csproj | 32 ++++++++++++- Graphing.sln | 6 +++ README.md | 88 ++++++++++++++++++++++++++++++++++++ {Base => Testing}/Program.cs | 2 +- Testing/Testing.csproj | 17 +++++++ Testing/Testing.csproj.user | 2 + 7 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 README.md rename {Base => Testing}/Program.cs (94%) create mode 100644 Testing/Testing.csproj create mode 100644 Testing/Testing.csproj.user diff --git a/.gitignore b/.gitignore index 06e1cb9..9b828e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ .vs/ + Base/obj/ Base/bin/ + +Testing/obj +Testing/bin diff --git a/Base/Base.csproj b/Base/Base.csproj index 5540514..9813a82 100644 --- a/Base/Base.csproj +++ b/Base/Base.csproj @@ -1,12 +1,42 @@  - WinExe + Library net8.0-windows enable true enable Graphing + ThatOneNerd.Graphing + True + True + ThatOneNerd.Graphing + ThatOneNerd.Graphing + 1.0.0 + That_One_Nerd + A fairly adept graphing calculator made in Windows Forms. + MIT + https://github.com/That-One-Nerd/Graphing + README.md + graphing;graph;plot;math;calculus;visual;desmos + MIT + True + snupkg + + embedded + + + + embedded + + + + + True + \ + + + \ No newline at end of file diff --git a/Graphing.sln b/Graphing.sln index 383ee05..9ff2aba 100644 --- a/Graphing.sln +++ b/Graphing.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Base", "Base\Base.csproj", "{2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "Testing\Testing.csproj", "{66F9A122-FA30-43CD-BC3A-9A8E0637DC52}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}.Debug|Any CPU.Build.0 = Debug|Any CPU {2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}.Release|Any CPU.ActiveCfg = Release|Any CPU {2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}.Release|Any CPU.Build.0 = Release|Any CPU + {66F9A122-FA30-43CD-BC3A-9A8E0637DC52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66F9A122-FA30-43CD-BC3A-9A8E0637DC52}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66F9A122-FA30-43CD-BC3A-9A8E0637DC52}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66F9A122-FA30-43CD-BC3A-9A8E0637DC52}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md new file mode 100644 index 0000000..7266efe --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# Graphing + +This is a graphing calculator I made initially for a Calculus project in a day or so. I've written a basic rendering system in Windows Forms that runs on .NET 8.0. + +Currently, it doesn't have a whole lot of features, but I'll be adding more in the future. Here's currently what it can do: +- Graph an equation (duh). + - There are currently some rendering issues with asymptotes which will be focused on at some point. +- Graph a slope field of a `dy/dx =` style equation. + +The system does not and likely will not (at least for a while) support text-to-equation parsing. You must import this project as a library and add graphs that way. + +There are some tools in the menu bar that can assist but those are fairly limited and will be added on to in the future. For now, you can drag to move the graph and use the mouse wheel to zoom. Fairly self-explanatory, I think. + +## How to Install + +This project is a NuGet package, so if you want to install it that way, you can do so. + +- In the terminal for your project, run `dotnet add package ThatOneNerd.Graphing` +- Alternatively, you can search for the package called "ThatOneNerd.Graphing" in the Visual Studio NuGet Package Manager. +- If you have an alternative package manager and know how to use it, then do that instead obviously. + +--- + +You can also directly import the DLL file. Go to the latest release and download the ZIP folder called "ThatOneNerd.Graphing.zip". Extract the contents somewhere you can access. +- In Visual Studio, you can then right click your project in the solution explorer, go to Add > Project Reference, and browse for the DLL called "ThatOneNerd.Graphing.dll" +- If you want to edit the project file itself, you can. Open the `.csproj` file and add the following lines to the XML: +```xml + + + FILE PATH GOES HERE (can be relative) + + +``` +- If you have a different IDE, I don't know how to help you with that. + +## How to Use + +Once you've installed the package, you just need to use standard Windows Forms startup code. + +```csharp +using Graphing.Forms; +using Graphing.Graphables; + +internal static class Program +{ + [STAThread] + public static void Main() + { + // Optional configuration. + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); + + // Create the graph form and give it a name. + GraphForm graph = new("Form Name"); + + // Graph the equation x^2. + graph.Graph(new Equation(x => x * x)); + + // Display the graph. + Application.Run(graph); + } +} +``` + +That's it. Not bad, eh? + +An equation requires a delegate such as the one you see. Alternatively, you can change the name and color of the equation. +```csharp +graph.Graph(new Equation(x => Math.Pow(2, x)) +{ + Color = Color.Green, + Name = "2^x" +}); +``` + +Default colors and names are assigned if none are provided. + +Slope fields work quite the same way, but with a delegate taking in both an `x` and a `y`. +```csharp +graph.Graph(new SlopeField((x, y) => -y / x) +{ + Color = Color.DarkRed, + Name = "Slope Field Example" +}); +``` + +You've got the hang of this. I'll be adding more features for a while. diff --git a/Base/Program.cs b/Testing/Program.cs similarity index 94% rename from Base/Program.cs rename to Testing/Program.cs index 69ae922..e622a5e 100644 --- a/Base/Program.cs +++ b/Testing/Program.cs @@ -1,7 +1,7 @@ using Graphing.Forms; using Graphing.Graphables; -namespace Graphing; +namespace Graphing.Testing; internal static class Program { diff --git a/Testing/Testing.csproj b/Testing/Testing.csproj new file mode 100644 index 0000000..00b21a5 --- /dev/null +++ b/Testing/Testing.csproj @@ -0,0 +1,17 @@ + + + + WinExe + net8.0-windows + enable + true + enable + Graphing.Testing + ThatOneNerd.Graphing.Testing + + + + + + + \ No newline at end of file diff --git a/Testing/Testing.csproj.user b/Testing/Testing.csproj.user new file mode 100644 index 0000000..317a8c7 --- /dev/null +++ b/Testing/Testing.csproj.user @@ -0,0 +1,2 @@ + + \ No newline at end of file