{"id":17084389,"url":"https://github.com/niklasf/rust-chessground","last_synced_at":"2025-04-12T20:32:40.865Z","repository":{"id":44566693,"uuid":"101163369","full_name":"niklasf/rust-chessground","owner":"niklasf","description":"An experimental chessboard widget for Relm/GTK","archived":false,"fork":false,"pushed_at":"2022-10-05T17:22:47.000Z","size":405,"stargazers_count":66,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T14:56:05.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/chessground","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklasf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"niklasf"}},"created_at":"2017-08-23T09:34:33.000Z","updated_at":"2025-03-19T06:17:36.000Z","dependencies_parsed_at":"2022-08-12T11:20:31.654Z","dependency_job_id":null,"html_url":"https://github.com/niklasf/rust-chessground","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Frust-chessground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Frust-chessground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Frust-chessground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Frust-chessground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklasf","download_url":"https://codeload.github.com/niklasf/rust-chessground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248630249,"owners_count":21136404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T13:06:58.239Z","updated_at":"2025-04-12T20:32:40.354Z","avatar_url":"https://github.com/niklasf.png","language":"Rust","funding_links":["https://github.com/sponsors/niklasf"],"categories":[],"sub_categories":[],"readme":"rust-chessground\n================\n\n[![crates.io](https://img.shields.io/crates/v/chessground.svg)](https://crates.io/crates/chessground)\n[![docs.rs](https://docs.rs/chessground/badge.svg)](https://docs.rs/chessground)\n\nAn *experimental* chessboard widget for [Relm/GTK](https://github.com/antoyo/relm).\nInspired by [chessground.js](https://github.com/ornicar/chessground).\n\n![](https://github.com/niklasf/rust-chessground/blob/master/screenshot.png?raw=true)\n\nRequirements\n------------\n\nNeeds [GTK+ installed](https://www.gtk.org/docs/installations/) on your operating system.\n\nFeatures\n--------\n\n* Uses vocabulary from [Shakmaty](https://github.com/niklasf/shakmaty) but is\n  chess rule agnostic\n* Can show legal move hints\n* Check hints\n* Move pieces by click\n* Move pieces by drag and drop\n  - Minimum distance\n  - Piece ghosts\n* Draw circles and arrows on the board\n* Integrated promotion dialog\n* Smooth animations\n\nOnly a minimum of the features is exposed in the public API. Feel free to\nrequest more.\n\nDocumentation\n-------------\n\n[Read the documentation](https://docs.rs/chessground)\n\nExample\n-------\n\nA board that lets the user freely move pieces. Run with `cargo run --example editor`.\n\n```rust\nextern crate gtk;\nextern crate chessground;\nextern crate relm;\n#[macro_use]\nextern crate relm_derive;\nextern crate shakmaty;\n\nuse gtk::prelude::*;\nuse relm::Widget;\nuse relm_derive::widget;\n\nuse shakmaty::{Square, Board};\nuse chessground::{Ground, UserMove, SetBoard};\n\nuse self::Msg::*;\n\n#[derive(Msg)]\npub enum Msg {\n    Quit,\n    PieceMoved(Square, Square),\n}\n\n#[widget]\nimpl Widget for Win {\n    fn model() -\u003e Board {\n        Board::default()\n    }\n\n    fn update(\u0026mut self, event: Msg) {\n        match event {\n            Quit =\u003e gtk::main_quit(),\n            PieceMoved(orig, dest) =\u003e {\n                if let Some(piece) = self.model.remove_piece_at(orig) {\n                    self.model.set_piece_at(dest, piece);\n                    self.components.ground.emit(SetBoard(self.model.clone()));\n                }\n            }\n        }\n    }\n\n    view! {\n        gtk::Window {\n            title: \"Chessground\",\n            #[name=\"ground\"]\n            Ground {\n                UserMove(orig, dest, _) =\u003e PieceMoved(orig, dest),\n            },\n            delete_event(_, _) =\u003e (Quit, Inhibit(false)),\n        }\n    }\n}\n\nfn main() {\n    Win::run(()).expect(\"initialized gtk\");\n}\n```\n\nPiece sets\n----------\n\nSet | Author | License\n--- | --- | ---\nMerida | Armando Hernandez Marroquin | [GPL-2+](https://www.gnu.org/licenses/gpl-2.0.txt)\n\nLicense\n-------\n\nChessground is licensed under the GPL-3.0 (or any later version at your\noption). See the COPYING file for the full license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasf%2Frust-chessground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklasf%2Frust-chessground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasf%2Frust-chessground/lists"}