Skip to content

Commit

Permalink
Feat(math): strock color& fill Color (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
xs10l3 authored Oct 5, 2024
1 parent c4e786d commit e9034c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/math/src/math-function.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface MathFunctionOptions extends FigureOptions, Growable {
divisionY?: number
color?: string
width?: number
fillColor?: string
}
const props = defineProps<MathFunctionOptions>()
Expand Down Expand Up @@ -42,7 +43,7 @@ const path = ref('')
watch(props, () => {
path.value = generateSvgPath(options.fn, {
x: options.ranges,
y: options.domain ?? [Infinity, Infinity],
y: options.domain ?? [ 0, 0],
}, options.divisionX ?? 100, options.divisionY ?? 100)
}, {
immediate: true,
Expand All @@ -51,6 +52,6 @@ watch(props, () => {

<template>
<g v-bind="figure(options)">
<Path :d="path" />
<Path :d="path" :stroke="options.color" :stroke-width="options.width" :fill-color="options.fillColor ?? 'none'" />
</g>
</template>

0 comments on commit e9034c0

Please sign in to comment.