Format MathML equations before submission to the GraphControl (#926)

* Format richedit input

* fix spelling error
This commit is contained in:
Pepe Rivera
2020-01-10 15:17:36 -08:00
committed by Stephanie Anderl
parent c8a67eb574
commit 397c180d52
12 changed files with 60 additions and 3 deletions

View File

@@ -859,6 +859,13 @@ String ^ Grapher::ConvertToLinear(String ^ mmlString)
return ref new String(linearExpression.c_str());
}
String ^ Grapher::FormatMathML(String ^ mmlString)
{
auto expression = m_solver->ParseInput(mmlString->Data());
auto formattedExpression = m_solver->Serialize(expression.get());
return ref new String(formattedExpression.c_str());
}
void Grapher::OnAxesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
{
if (m_graph)

View File

@@ -104,6 +104,7 @@ public
event Windows::Foundation::EventHandler<Windows::Foundation::Collections::IMap<Platform::String ^, double> ^> ^ VariablesUpdated;
void SetVariable(Platform::String ^ variableName, double newValue);
Platform::String ^ ConvertToLinear(Platform::String ^ mmlString);
Platform::String ^ FormatMathML(Platform::String ^ mmlString);
/// <summary>
/// Draw the graph. Call this method if you add or modify an equation.