โปรแกรมนี้ช่วยให้ผู้ใช้สามารถเข้าใจและจำลองการถ่ายทอดลักษณะทางพันธุกรรมได้อย่างง่ายดาย โดยใช้กฎของเมนเดลเป็นพื้นฐาน
- การเลือก genotype ของพ่อแม่ (AA, Aa, aa)
- แสดงผลด้วย Punnett Square แบบ interactive
- คำอธิบายแบบ animated text พร้อม hover effect
- กราฟ donut chart แสดงสัดส่วน dominant/recessive
- Dark mode UI ที่ทันสมัย
- Fullscreen mode พร้อมปุ่ม Escape เพื่อออก
- ติดตั้ง Python 3.x
- ติดตั้ง dependencies:
pip install tkinter
pip install matplotlib
pip install numpy- รันโปรแกรม:
python inheritance_calculator.py- เลือก genotype ของ Parent 1 และ Parent 2
- กดปุ่ม "Calculate Inheritance"
- ดูผลลัพธ์จาก:
- Punnett Square
- คำอธิบายการถ่ายทอด
- กราฟแสดงสัดส่วน
- Python 3.x
- tkinter
- matplotlib
- numpy
Law_of_Inheri/
├── inheritance_calculator.py # โค้ดหลัก
└── README.md # เอกสารอธิบาย
ModernMendelGUI: คลาสหลักของแอพพลิเคชันcreate_layout(): สร้าง UI หลักcreate_input_section(): สร้างส่วนเลือก genotypecreate_punnett_square(): สร้างตาราง Punnettcreate_explanation_section(): สร้างส่วนคำอธิบายcreate_visualization_section(): สร้างส่วนแสดงกราฟcalculate_inheritance(): คำนวณผลการถ่ายทอดanimate_explanation(): สร้าง animation สำหรับคำอธิบาย
colors = {
'bg_dark': '#1a1a1a', # พื้นหลังหลัก
'bg_darker': '#0d0d0d', # พื้นหลังเข้ม
'text': '#ffffff', # ข้อความหลัก
'text_secondary': '#b3b3b3', # ข้อความรอง
'accent': '#00ffff', # สีเน้น
'border': '#333333', # เส้นขอบ
'dominant': '#4dff88', # สีแสดง dominant
'recessive': '#ff6b6b', # สีแสดง recessive
}- เพิ่มการจำลองกฎข้อที่ 2 ของเมนเดล
- เพิ่มการบันทึกและโหลดผลการคำนวณ
- เพิ่มภาษาไทย
- เพิ่มการ export ผลลัพธ์เป็น PDF
- เพิ่มแอนิเมชันการถ่ายทอด
- Thiraphat Chorakhe
This project is licensed under the MIT License - see the LICENSE file for details
- Tkinter สำหรับ GUI
- Matplotlib สำหรับการสร้างกราฟ
- NumPy สำหรับการคำนวณ
หากมีคำถามหรือข้อเสนอแนะ สามารถติดต่อได้ที่:
- Email: [email protected]
- GitHub: https://github.com/OTRONTO-F