Spaces:
Sleeping
Sleeping
Hướng dẫn test với file mmap.txt
Bước 1: Tạo file .mmap từ XML
File mmap.txt của bạn chứa XML thuần. Để test tính năng import, bạn cần tạo file .mmap đúng định dạng (ZIP archive):
Cách 1: Sử dụng script Python
import zipfile
import os
# Đọc XML từ file
with open('mmap.txt', 'r', encoding='utf-8') as f:
xml_content = f.read()
# Tạo file .mmap (ZIP)
with zipfile.ZipFile('test.mmap', 'w', zipfile.ZIP_DEFLATED) as zipf:
# Thêm XML vào ZIP với tên Document.xml
zipf.writestr('Document.xml', xml_content)
print("Created test.mmap successfully!")
Chạy: python create_mmap.py
Cách 2: Thủ công với WinRAR/7-Zip
- Đổi tên
mmap.txtthànhDocument.xml - Nén file
Document.xmlbằng WinRAR hoặc 7-Zip - Đổi extension file nén từ
.zipthành.mmap
Cách 3: PowerShell (Windows)
# Đọc XML
$xmlContent = Get-Content -Path "mmap.txt" -Raw -Encoding UTF8
# Tạo thư mục tạm
$tempDir = "temp_mmap"
New-Item -ItemType Directory -Path $tempDir -Force
# Lưu XML với tên Document.xml
$xmlContent | Out-File -FilePath "$tempDir\Document.xml" -Encoding UTF8
# Tạo ZIP
Compress-Archive -Path "$tempDir\*" -DestinationPath "test.zip" -Force
# Đổi thành .mmap
Move-Item -Path "test.zip" -Destination "test.mmap" -Force
# Dọn dẹp
Remove-Item -Path $tempDir -Recurse -Force
Write-Host "Created test.mmap successfully!"
Chạy trong PowerShell: .\create_mmap.ps1
Bước 2: Test import
Khởi động ứng dụng:
npm run startMở trình duyệt tại
http://localhost:4200Click Menu (☰) > Open > Import MindManager (.mmap)
Chọn file
test.mmapđã tạoMind map của bạn sẽ hiển thị!
Bước 3: Debug (nếu cần)
Mở Developer Console (F12) để xem log:
- Nếu thành công: sẽ thấy các elements được tạo
- Nếu lỗi: sẽ có error message chi tiết
Ví dụ kết quả mong đợi
Từ file XML của bạn, sẽ tạo ra:
- 1 rectangle "KẾ HOẠCH GIÁO DỤC LỚP 4 - 5 TUỔI B" (center topic)
- Các rectangles cho các topics con:
- "ĐẶC ĐIỂM TÌNH HÌNH LỚP"
- "KẾ HOẠCH GIÁO DỤC NĂM"
- "KẾ HOẠCH GIÁO DỤC THÁNG"
- "KẾ HOẠCH HOẠT ĐỘNG VUI CHƠI"
- "THEO DÕI HỌC SINH"
- "ĐÁNH GIÁ TRẺ"
- Lines kết nối giữa các topics