Version 1.0 is ready to be published.

This commit is contained in:
That_One_Nerd 2024-02-27 15:49:25 -05:00
parent 8d5e2257fc
commit 48476dde69
7 changed files with 149 additions and 2 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
.vs/ .vs/
Base/obj/ Base/obj/
Base/bin/ Base/bin/
Testing/obj
Testing/bin

View File

@ -1,12 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Graphing</RootNamespace> <RootNamespace>Graphing</RootNamespace>
<AssemblyName>ThatOneNerd.Graphing</AssemblyName>
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>ThatOneNerd.Graphing</PackageId>
<Title>ThatOneNerd.Graphing</Title>
<Version>1.0.0</Version>
<Authors>That_One_Nerd</Authors>
<Description>A fairly adept graphing calculator made in Windows Forms. </Description>
<Copyright>MIT</Copyright>
<RepositoryUrl>https://github.com/That-One-Nerd/Graphing</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>graphing;graph;plot;math;calculus;visual;desmos</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 17.8.34309.116
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Base", "Base\Base.csproj", "{2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Base", "Base\Base.csproj", "{2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "Testing\Testing.csproj", "{66F9A122-FA30-43CD-BC3A-9A8E0637DC52}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{2BA8787B-1341-4DBC-80E8-5DABA8ECBBD6}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

88
README.md Normal file
View File

@ -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
<ItemGroup>
<Reference Include="Graphing">
<HintPath>FILE PATH GOES HERE (can be relative)</HintPath>
</Reference>
</ItemGroup>
```
- 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.

View File

@ -1,7 +1,7 @@
using Graphing.Forms; using Graphing.Forms;
using Graphing.Graphables; using Graphing.Graphables;
namespace Graphing; namespace Graphing.Testing;
internal static class Program internal static class Program
{ {

17
Testing/Testing.csproj Normal file
View File

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Graphing.Testing</RootNamespace>
<AssemblyName>ThatOneNerd.Graphing.Testing</AssemblyName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />