
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
ngx-math-function-plotter
Advanced tools
An angular library that has a component for plotting math functions with built in math expressions and single variable computation.
This project was generated with Angular CLI version 7.0.2.
An angular library that has a component for plotting math functions with built in math expressions & single variable computation.
Table of supported math operations:
| Operation | Syntax | # of operands |
|---|---|---|
| Addition | + | 2 |
| Subtraction | sub | 2 |
| Multiplication | * | 2 |
| Division | / | 2 |
| L.Parantheses | ( | >=1 |
| R.Parantheses | ) | >=1 |
| sin | sin | 1 |
| cos | cos | 1 |
| tan | tan | 1 |
| seq | seq | 1 |
| csc | csc | 1 |
| cot | cot | 1 |
| power | ^ | 2 |
| square root | sqr | 1 |
| minus | - | 1 |
Inside your module import it as:
import {NgxMathFunctionPlotterModule} from 'ngx-math-function-plotter';
Then inside your component .html add the plotter component tag:
<ngx-math-function-plotter [functionInput]="'sin(x)'" [maxDisplayValue]="10" [width]="600" [height]="600">
</ngx-math-function-plotter>
Result will be as follow:
For parsing mathmatical expressions service NgxSingleVariableFunctionParserService can be used inside needed component .ts:
First import the service as follows:
import { NgxSingleVariableFunctionParserService } from 'ngx-math-function-plotter';
Then inside the class will be as:
export class AppComponent {
title = 'PlotterTest';
mathExpressionParser: NgxSingleVariableFunctionParserService;
constructor(mathExpressionParser: NgxSingleVariableFunctionParserService) {
this.mathExpressionParser = mathExpressionParser;
this.mathExpressionParser.setMathFunctionText('x+1'); // single variable expression
const number = this.mathExpressionParser.computeFunctionAtValue(1); // 2 is displayed
alert(number);
this.mathExpressionParser.setMathFunctionText('sqr(4*4)'); // constant expression
// input in following statement has no effect since expression is constant
const constantExpressionResult = this.mathExpressionParser.computeFunctionAtValue(0);
alert(constantExpressionResult); // 4 is displayed
}
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test --project NgxMathFunctionPlotter to execute the unit tests via Karma.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
FAQs
An angular library that has a component for plotting math functions with built in math expressions and single variable computation.
The npm package ngx-math-function-plotter receives a total of 1 weekly downloads. As such, ngx-math-function-plotter popularity was classified as not popular.
We found that ngx-math-function-plotter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.