Skip to content

MathFunction


Creat function

Parameters

nametypedata typedescriptiondefault value
fnrequired(x: number) => numberCalculation method of the mathematical function.
rangesrequired[number, number]The range of the function.
domainoptional[number, number]The domain of the function[0, 0]
divisionXoptionalnumberUsed to control the granularity of the function graph along the x-axis.100
divisionYoptionalnumberUsed to control the granularity of the function graph along the y-axis.100
coloroptionalstringUsed to set the color of the function graph during rendering.white
widthoptionalnumberUsed to control the width of the function graph in the drawing area.1
fillColoroptionalstringUsed to set the fill color of the function graph during rendering.none

Example code snippet

html
<MathFunction
  :fn="(x:any) => Math.sin(x)"
  color="skyblue"
  :ranges="[0, 0]"
  :domain="[0,  Math.PI*2]"
  wid="fn1"
/>

Released under the Apache-2.0 license