capacitor-gaussiancf-plugin
v0.0.14
Published
Calculate gaussian curve
Downloads
3
Maintainers
Readme
typescript
import { Component } from '@angular/core';
import { Plugins } from '@capacitor/core';
import 'capacitor-gaussiancf-plugin';
const { Gaussian } = Plugins;
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
results: any;
constructor() {
this.gaussianCurveFitter();
}
async gaussianCurveFitter() {
Gaussian.gaussianCurveFitter({value: JSON.stringify({x: [10, 20, 30], y: [10, 20, 30]})})
.then(result => {
console.log(result.value);
console.log(JSON.parse(result.value).length);
this.results = result;
});
}
}
mainactivity.java
package io.ionic.starter;
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import com.bhavik.gaussiancf.plugin.GaussianCF; // Add this line
import java.util.ArrayList;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(GaussianCF.class); // Add this line
}});
}
}