Skip to content

Commit

Permalink
refactor: 换用 psych-lib 进行正态分布生成
Browse files Browse the repository at this point in the history
  • Loading branch information
LeafYeeXYZ committed Nov 5, 2024
1 parent 4fd755b commit 5ce04ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions src/tools/NormalDistribution.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import normal from '@stdlib/random/base/normal'
import { Button, InputNumber, Tag, Space, Input } from 'antd'
import { useState, useRef, useEffect } from 'react'
import { DeleteOutlined, PauseOutlined, PlaySquareOutlined } from '@ant-design/icons'
import { mean as m, std as s } from '@psych/lib'
import { mean as m, std as s, randomNormal } from '@psych/lib'
import * as echarts from 'echarts'
import { useZustand } from '../lib/useZustand'

Expand Down Expand Up @@ -36,7 +35,7 @@ export function NormalDistribution() {
const generate = (times: number = 1) => {
const result: number[] = []
for (let i = 0; i < times; i++) {
result.push(normal(mean, std))
result.push(randomNormal(mean, std))
}
setData(draft => [...draft, ...result])
}
Expand Down
1 change: 0 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default defineConfig({
'stdlib': [
'@stdlib/stats/kstest',
'@stdlib/stats/levene-test',
'@stdlib/random/base/normal',
],
'utils': [
'html2canvas',
Expand Down

0 comments on commit 5ce04ec

Please sign in to comment.