-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change AngouriMath reference to use NuGet package instead of git subm…
…odule (#149) * Waiting for AngouriMath to fix bugs * More interval tests * Parse -> Visualize * Updated but more failing tests * Include Visual Studio automatic updates * A lot less failing tests now * Fix intervals with same boundaries * Update simplification of fractions * Update * Update! * Make buildable * Fix typo * Update * Update * Update * Use = instead of -> * Add a calculator to Avalonia Example * Update * Preparing to remove AngouriMath submodule * Use AngouriMath package * Allow matrices in square brackets * Maybe not exponentiations for ordinary matrix environments * Simplify reference * Resolve the new possible test into QuarticSolution * Fix blurry MathButtons & Update Avalonia to 0.10.0-preview2 * Fix test * Fix test (actually)
- Loading branch information
1 parent
ab9f87c
commit aabb520
Showing
29 changed files
with
456 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule AngouriMath
deleted from
4bfbd5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
using Avalonia.Markup.Xaml.Styling; | ||
|
||
namespace CSharpMath.Avalonia.Example { | ||
public class MainView : UserControl { | ||
public MainView() { | ||
InitializeComponent(); | ||
|
||
var light = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml'/>"); | ||
var dark = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml'/>"); | ||
var themes = this.Find<RadioButton>("lightThemeRbn"); | ||
themes.Checked += (sender, e) => Application.Current.Styles[0] = light; | ||
themes.Unchecked += (sender, e) => Application.Current.Styles[0] = dark; | ||
} | ||
|
||
private void InitializeComponent() { | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
} | ||
} | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
using Avalonia.Styling; | ||
|
||
namespace CSharpMath.Avalonia.Example { | ||
public class MainView : UserControl { | ||
public MainView() { | ||
InitializeComponent(); | ||
|
||
var light = (Styles)AvaloniaXamlLoader.Load(new System.Uri("avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml")); | ||
var dark = (Styles)AvaloniaXamlLoader.Load(new System.Uri("avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml")); | ||
var themes = this.Find<RadioButton>("lightThemeRbn"); | ||
themes.Checked += (sender, e) => Application.Current.Styles[0] = light; | ||
themes.Unchecked += (sender, e) => Application.Current.Styles[0] = dark; | ||
} | ||
|
||
private void InitializeComponent() { | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:sys="clr-namespace:System;assembly=mscorlib" | ||
xmlns:csmath="clr-namespace:CSharpMath.Avalonia;assembly=CSharpMath.Avalonia" | ||
xmlns:local="clr-namespace:CSharpMath.Avalonia.Example.Pages" | ||
x:Class="CSharpMath.Avalonia.Example.Pages.CalculatorPage"> | ||
|
||
<ScrollViewer Margin="0, 8" HorizontalScrollBarVisibility="Auto"> | ||
|
||
<StackPanel Spacing="24"> | ||
|
||
<StackPanel Spacing="4"> | ||
|
||
<TextBlock Classes="h1" | ||
Text="CSharpMath.Evaluation.Evaluate" /> | ||
|
||
<TextBlock Classes="h2" | ||
Text="Evaluates a MathList that can be constructed from LaTeX" /> | ||
|
||
</StackPanel> | ||
|
||
<TextBox Name="input" AcceptsReturn="True" TextWrapping="Wrap" Text="x^4+4x^3+16x^2+4x+1=y" /> | ||
|
||
<csmath:MathView LaTeX="{Binding #input.Text, Converter={x:Static local:CalculatorPageConverter.Singleton}}" /> | ||
|
||
</StackPanel> | ||
|
||
</ScrollViewer> | ||
|
||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Globalization; | ||
using Avalonia.Controls; | ||
using Avalonia.Data.Converters; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace CSharpMath.Avalonia.Example.Pages { | ||
public class CalculatorPage : UserControl { | ||
public CalculatorPage() => AvaloniaXamlLoader.Load(this); | ||
} | ||
class CalculatorPageConverter : IValueConverter { | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => | ||
value is string latex | ||
? Atom.LaTeXParser.MathListFromLaTeX(latex) | ||
.Bind(list => Evaluation.Interpret(list)) | ||
.Match(success => success, error => latex) | ||
: value; | ||
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => | ||
throw new NotImplementedException(); | ||
public static CalculatorPageConverter Singleton { get; } = new CalculatorPageConverter(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.