@tkzwhr/kaya
v0.9.2
Published
Kaya ==
Downloads
0
Readme
Kaya

Pure Go/Weiqi/Baduk UI library, independent of any specific UI libraries such as React, Vue, etc.
Features
- [x] Board operation
- [x] Load SGF
- [x] from a raw text
- [ ] from a file
- [ ] Symbol such as circle, triangle, etc.
- [ ] Multiple path
- [ ] Board size
- [x] 9, 13, 19
- [x] Square of any size
- [ ] Rectangle of any size
- [x] Keyboard operation
- [x] Mouse wheel operation
Requirement
- @sabaki/go-board (installed automatically)
- @sabaki/immutable-gametree (installed automatically)
- @sabaki/sgf (installed automatically)
Installation
npm install kayaUsage
<script>
import Kaya from "kaya";
const el = document.getElementById("board");
if (el) {
const kaya = new Kaya(el, {
sgfText: "(;GM[1]FF[4]SZ[9];B[aa];W[ba];B[bb];W[ab];B[];W[])",
});
window.kaya = kaya;
}
</script>Constructor(element, options)
element: HTMLElement: create a go board UI into the elementoptions: KayaOptions: set up the board
KayaOptions
sgfText?: string: specify SGF textenableKeyboard?: boolean: enable keyboard operation [default: true]enableWheel?: boolean: enable wheel operation [default: true]
#navigate(steps)
Simulate the state of the game.
steps: number: if positive forward the state of the game to specified number, if negative rewind the state of the game to specified number
Note
Author
- Hiroki Takizawa
License
Kaya is under MIT license.
