@geothai/maps-react 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +14 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2,6 +2,19 @@ import { render } from "@geothai/maps";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  // src/index.tsx
4
4
  function Node({ node }) {
5
+ if (node.kind === "label") return /* @__PURE__ */ jsx("text", {
6
+ x: node.x,
7
+ y: node.y,
8
+ fontSize: node.size,
9
+ textAnchor: "middle",
10
+ dominantBaseline: "central",
11
+ fill: "#0f1115",
12
+ stroke: "#ffffff",
13
+ strokeWidth: node.size / 5,
14
+ paintOrder: "stroke",
15
+ strokeLinejoin: "round",
16
+ children: node.text
17
+ });
5
18
  if (node.kind === "line") return /* @__PURE__ */ jsx("path", {
6
19
  d: node.d,
7
20
  fill: "none",
@@ -38,7 +51,7 @@ function GeoThaiMap(props) {
38
51
  viewBox: model.viewBox,
39
52
  role: "img",
40
53
  "aria-label": model.title,
41
- children: [/* @__PURE__ */ jsx("title", { children: model.title }), model.nodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n }, n.kind === "area" ? n.code : n.key))]
54
+ children: [/* @__PURE__ */ jsx("title", { children: model.title }), model.nodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n }, n.kind === "line" ? n.key : `${n.kind}${n.code}`))]
42
55
  });
43
56
  }
44
57
  export { GeoThaiMap };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geothai/maps-react",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "React component for maps of Thailand, on DOPA codes",
5
5
  "keywords": [
6
6
  "choropleth",
@@ -33,7 +33,7 @@
33
33
  "typecheck": "tsc"
34
34
  },
35
35
  "dependencies": {
36
- "@geothai/maps": "^0.1.1"
36
+ "@geothai/maps": "^0.3.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@repo/typescript": "workspace:*",