TenkaMapfunction
THE WORLD, AS A REACT COMPONENT: every territory in its owner's colour,
its counter of armies, the rings of a choice, and a press on a territory
or its counter reported by number. It draws; the rules stay in
playTenka, and what a press means in tapTerritory. Scales to its
container's width; style .tk-land, .tk-sea and the rest as you like.
Where a press is wanted, each territory can be reached by Tab and pressed
with Enter or Space.
Import it
import { TenkaMap } from "@johnmorrisdotca/tenka/react";
Definition
function TenkaMap({ game, marks, colours, onTerritory, label, ...svg }: TenkaMapProps): React.JSX.Element
Parameters
| Name | Type | Description |
|---|---|---|
options | TenkaMapProps | The component, table or display options. |
Returns
React.JSX.Element
The React SVG map element.
Examples
import {createElement} from "react";
import { TenkaMap } from "@johnmorrisdotca/tenka/react";
import {startTenka} from "@johnmorrisdotca/tenka";
const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(createElement(TenkaMap,{game}));