@ktnpm_devops/react-component 0.12.1 → 0.13.1
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.
- package/README.md +39 -0
- package/dist/constants.d.ts +26 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/geo/GeoMapCard/GeoMapCard.d.ts +7 -0
- package/dist/geo/GeoMapCard/GeoMapCard.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts +91 -0
- package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/MapLegend.d.ts +12 -0
- package/dist/geo/GeoMapCard/MapLegend.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/MapViewport.d.ts +17 -0
- package/dist/geo/GeoMapCard/MapViewport.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/PointListing.d.ts +14 -0
- package/dist/geo/GeoMapCard/PointListing.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts +47 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/index.d.ts +3 -0
- package/dist/geo/GeoMapCard/index.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/normalizePoints.d.ts +26 -0
- package/dist/geo/GeoMapCard/normalizePoints.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/normalizePoints.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/normalizePoints.test.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts +13 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts.map +1 -0
- package/dist/geo/index.d.ts +3 -0
- package/dist/geo/index.d.ts.map +1 -0
- package/dist/hooks/useThemeMode.d.ts +8 -0
- package/dist/hooks/useThemeMode.d.ts.map +1 -0
- package/dist/index.cjs +52 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -48
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +45 -14
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +46 -15
- package/dist/index10.js.map +1 -1
- package/dist/index100.cjs +35 -2
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +36 -3
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +52 -10
- package/dist/index101.cjs.map +1 -1
- package/dist/index101.js +52 -10
- package/dist/index101.js.map +1 -1
- package/dist/index102.cjs +134 -22
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +133 -21
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +42 -36
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +42 -36
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +35 -21
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +34 -20
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +43 -24
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +42 -23
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +27 -0
- package/dist/index106.cjs.map +1 -0
- package/dist/index106.js +27 -0
- package/dist/index106.js.map +1 -0
- package/dist/index107.cjs +22 -0
- package/dist/index107.cjs.map +1 -0
- package/dist/index107.js +22 -0
- package/dist/index107.js.map +1 -0
- package/dist/index108.cjs +16 -0
- package/dist/index108.cjs.map +1 -0
- package/dist/index108.js +16 -0
- package/dist/index108.js.map +1 -0
- package/dist/index109.cjs +63 -0
- package/dist/index109.cjs.map +1 -0
- package/dist/index109.js +63 -0
- package/dist/index109.js.map +1 -0
- package/dist/index11.cjs +14 -15
- package/dist/index11.cjs.map +1 -1
- package/dist/index11.js +15 -16
- package/dist/index11.js.map +1 -1
- package/dist/index110.cjs +36 -0
- package/dist/index110.cjs.map +1 -0
- package/dist/index110.js +36 -0
- package/dist/index110.js.map +1 -0
- package/dist/index111.cjs +18 -0
- package/dist/index111.cjs.map +1 -0
- package/dist/index111.js +18 -0
- package/dist/index111.js.map +1 -0
- package/dist/index112.cjs +27 -0
- package/dist/index112.cjs.map +1 -0
- package/dist/index112.js +27 -0
- package/dist/index112.js.map +1 -0
- package/dist/index113.cjs +21 -0
- package/dist/index113.cjs.map +1 -0
- package/dist/index113.js +21 -0
- package/dist/index113.js.map +1 -0
- package/dist/index12.cjs +15 -4
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +15 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +4 -16
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +4 -16
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +16 -10
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +16 -10
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +10 -100
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +11 -101
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +100 -20
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +101 -21
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +20 -54
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +20 -54
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +52 -16
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +54 -18
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +16 -24
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +17 -25
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +22 -39
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +23 -40
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +38 -85
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +40 -87
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +84 -152
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +87 -155
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +149 -127
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +150 -128
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +121 -106
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +122 -107
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +121 -17
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +121 -17
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +16 -163
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +16 -163
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +163 -21
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +164 -22
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +20 -129
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +21 -130
- package/dist/index28.js.map +1 -1
- package/dist/index29.cjs +129 -75
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +131 -77
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +152 -7
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +154 -9
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +74 -128
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +75 -129
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +6 -54
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +8 -56
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +128 -35
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +129 -36
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +50 -220
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +53 -223
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +38 -34
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +39 -35
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +221 -105
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +224 -108
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +30 -64
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +31 -65
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +105 -73
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +108 -76
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +63 -54
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +64 -55
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +68 -143
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +70 -145
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +57 -96
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +59 -98
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +147 -66
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +149 -68
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +97 -7
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +99 -9
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +72 -17
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +73 -18
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +7 -76
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +9 -78
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +17 -143
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +17 -143
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +72 -59
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +74 -61
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +135 -97
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +136 -98
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +49 -32
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +49 -32
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +105 -6
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +106 -7
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +44 -144
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +45 -145
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +6 -8
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +6 -8
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +145 -15
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +147 -17
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +7 -65
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +9 -67
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +19 -16
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +18 -15
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +67 -24
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +66 -23
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +15 -69
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +15 -69
- package/dist/index57.js.map +1 -1
- package/dist/index59.cjs +26 -0
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +26 -0
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +13 -16
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +13 -16
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +10 -22
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +11 -23
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +13 -13
- package/dist/index62.js +13 -13
- package/dist/index63.cjs +20 -14
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +20 -14
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +34 -13
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +34 -13
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -1
- package/dist/index66.cjs +2 -20
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +3 -21
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +5 -23
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +6 -24
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +19 -19
- package/dist/index68.js +20 -20
- package/dist/index69.cjs +20 -5
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +21 -6
- package/dist/index69.js.map +1 -1
- package/dist/index7.cjs +32 -64
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +32 -64
- package/dist/index7.js.map +1 -1
- package/dist/index70.cjs +15 -15
- package/dist/index70.js +15 -15
- package/dist/index71.cjs +13 -28
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +14 -29
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +2 -20
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +2 -20
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +30 -3
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +30 -3
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +36 -3
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +36 -3
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +34 -13
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +35 -14
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +22 -13
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +23 -14
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +3 -30
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +3 -30
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +16 -10
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +16 -10
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +10 -34
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +11 -35
- package/dist/index79.js.map +1 -1
- package/dist/index8.cjs +58 -75
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +58 -75
- package/dist/index8.js.map +1 -1
- package/dist/index80.cjs +64 -10
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +65 -11
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +16 -4
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +17 -5
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +52 -134
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +51 -133
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +50 -38
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +50 -38
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +16 -76
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +16 -76
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +20 -2
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +20 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +77 -44
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +78 -45
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +2 -53
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +3 -54
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +15 -36
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +16 -37
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +26 -14
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +26 -14
- package/dist/index89.js.map +1 -1
- package/dist/index9.cjs +81 -45
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js +81 -45
- package/dist/index9.js.map +1 -1
- package/dist/index90.cjs +22 -116
- package/dist/index90.cjs.map +1 -1
- package/dist/index90.js +21 -115
- package/dist/index90.js.map +1 -1
- package/dist/index91.cjs +116 -43
- package/dist/index91.cjs.map +1 -1
- package/dist/index91.js +115 -42
- package/dist/index91.js.map +1 -1
- package/dist/index92.cjs +35 -32
- package/dist/index92.cjs.map +1 -1
- package/dist/index92.js +35 -32
- package/dist/index92.js.map +1 -1
- package/dist/index93.cjs +26 -17
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +27 -18
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +9 -39
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +8 -38
- package/dist/index94.js.map +1 -1
- package/dist/index95.cjs +21 -92
- package/dist/index95.cjs.map +1 -1
- package/dist/index95.js +20 -91
- package/dist/index95.js.map +1 -1
- package/dist/index96.cjs +47 -32
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +47 -32
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +25 -49
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +25 -49
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +39 -30
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +38 -29
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +92 -57
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +91 -56
- package/dist/index99.js.map +1 -1
- package/dist/style.css +207 -0
- package/dist/types/geo.types.d.ts +45 -0
- package/dist/types/geo.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +16 -2
package/dist/index99.js
CHANGED
|
@@ -1,60 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { CHART_COLORS, SCATTER } from "./index59.js";
|
|
2
|
+
const AXIS_NAME_GAP = { X: 28, Y: 38 };
|
|
3
|
+
const GRID_MARGIN = {
|
|
4
|
+
BASE: 8,
|
|
5
|
+
TOP: 16,
|
|
6
|
+
RIGHT: 16,
|
|
7
|
+
X_NAME: 23,
|
|
8
|
+
Y_NAME: 34,
|
|
9
|
+
LEGEND: 30
|
|
10
|
+
};
|
|
11
|
+
const UNCATEGORISED_SERIES = "Points";
|
|
12
|
+
const escapeHtml = (value) => value.replace(/[&<>"]/g, (char) => `&#${char.charCodeAt(0)};`);
|
|
13
|
+
const symbolSizeFor = (weight, minWeight, maxWeight) => {
|
|
14
|
+
if (maxWeight === minWeight) return SCATTER.BASE_SYMBOL_SIZE;
|
|
15
|
+
const ratio = Math.sqrt((weight - minWeight) / (maxWeight - minWeight));
|
|
16
|
+
return SCATTER.MIN_SYMBOL_SIZE + (SCATTER.MAX_SYMBOL_SIZE - SCATTER.MIN_SYMBOL_SIZE) * ratio;
|
|
17
|
+
};
|
|
18
|
+
const groupByCategory = (points) => {
|
|
19
|
+
const groups = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const folded of points) {
|
|
21
|
+
const key = folded.point.category ?? UNCATEGORISED_SERIES;
|
|
22
|
+
const group = groups.get(key);
|
|
23
|
+
if (group) group.push(folded);
|
|
24
|
+
else groups.set(key, [folded]);
|
|
25
|
+
}
|
|
26
|
+
return groups;
|
|
27
|
+
};
|
|
28
|
+
const toDataItem = (folded, sizeOf) => ({
|
|
29
|
+
name: folded.point.label,
|
|
30
|
+
value: [folded.point.x, folded.point.y, folded.count, folded.index],
|
|
31
|
+
symbolSize: sizeOf(folded.point.weight)
|
|
32
|
+
});
|
|
33
|
+
const buildTooltipFormatter = (config) => (params) => {
|
|
34
|
+
const { name, seriesName, value, marker } = params;
|
|
35
|
+
const [x, y, count] = value;
|
|
36
|
+
const lines = [`${marker} ${escapeHtml(name)}`];
|
|
37
|
+
lines.push(`${escapeHtml(config.xLabel ?? "x")}: ${x}`);
|
|
38
|
+
lines.push(`${escapeHtml(config.yLabel ?? "y")}: ${y}`);
|
|
39
|
+
if (seriesName !== UNCATEGORISED_SERIES) {
|
|
40
|
+
lines.push(`${escapeHtml(config.categoryLabel ?? "Category")}: ${escapeHtml(seriesName)}`);
|
|
41
|
+
}
|
|
42
|
+
if (count > 1) lines.push(`${count} points here`);
|
|
43
|
+
return lines.join("<br/>");
|
|
44
|
+
};
|
|
45
|
+
const buildScatterOption = (points, config) => {
|
|
46
|
+
const weights = points.map((p) => p.point.weight).filter((w) => w != null);
|
|
47
|
+
const minWeight = weights.length > 0 ? Math.min(...weights) : 0;
|
|
48
|
+
const maxWeight = weights.length > 0 ? Math.max(...weights) : 0;
|
|
49
|
+
const sizeOf = (weight) => weights.length === 0 ? SCATTER.BASE_SYMBOL_SIZE : symbolSizeFor(weight ?? minWeight, minWeight, maxWeight);
|
|
50
|
+
const groups = groupByCategory(points);
|
|
51
|
+
const series = [...groups.entries()].map(([category, group], i) => ({
|
|
52
|
+
name: category,
|
|
53
|
+
type: "scatter",
|
|
54
|
+
data: group.map((folded) => toDataItem(folded, sizeOf)),
|
|
55
|
+
itemStyle: { color: CHART_COLORS[i % CHART_COLORS.length], opacity: 0.85 },
|
|
56
|
+
emphasis: { focus: "series" }
|
|
57
|
+
}));
|
|
58
|
+
return {
|
|
59
|
+
tooltip: { trigger: "item", formatter: buildTooltipFormatter(config) },
|
|
60
|
+
legend: config.showLegend ? { bottom: 0, type: "scroll" } : void 0,
|
|
61
|
+
grid: {
|
|
62
|
+
left: config.yLabel ? GRID_MARGIN.Y_NAME : GRID_MARGIN.BASE,
|
|
63
|
+
right: GRID_MARGIN.RIGHT,
|
|
64
|
+
top: GRID_MARGIN.TOP,
|
|
65
|
+
// Room for the x axis name and the legend, each only when drawn.
|
|
66
|
+
bottom: GRID_MARGIN.BASE + (config.xLabel ? GRID_MARGIN.X_NAME : 0) + (config.showLegend ? GRID_MARGIN.LEGEND : 0),
|
|
67
|
+
containLabel: true
|
|
68
|
+
},
|
|
69
|
+
xAxis: {
|
|
70
|
+
type: "value",
|
|
71
|
+
name: config.xLabel,
|
|
72
|
+
nameLocation: "middle",
|
|
73
|
+
nameGap: AXIS_NAME_GAP.X,
|
|
74
|
+
scale: true
|
|
75
|
+
},
|
|
76
|
+
yAxis: {
|
|
77
|
+
type: "value",
|
|
78
|
+
name: config.yLabel,
|
|
79
|
+
nameLocation: "middle",
|
|
80
|
+
// Without this the y name is drawn horizontally and eats the plot's width.
|
|
81
|
+
nameRotate: 90,
|
|
82
|
+
nameGap: AXIS_NAME_GAP.Y,
|
|
83
|
+
scale: true
|
|
84
|
+
},
|
|
85
|
+
dataZoom: config.enableDataZoom ? [
|
|
86
|
+
{ type: "inside", xAxisIndex: 0 },
|
|
87
|
+
{ type: "inside", yAxisIndex: 0 }
|
|
88
|
+
] : void 0,
|
|
89
|
+
series
|
|
90
|
+
};
|
|
38
91
|
};
|
|
39
92
|
export {
|
|
40
|
-
|
|
41
|
-
chevron,
|
|
42
|
-
clear,
|
|
43
|
-
styles as default,
|
|
44
|
-
focused,
|
|
45
|
-
label,
|
|
46
|
-
list,
|
|
47
|
-
noResults,
|
|
48
|
-
option,
|
|
49
|
-
optionCount,
|
|
50
|
-
optionLabel,
|
|
51
|
-
panel,
|
|
52
|
-
root,
|
|
53
|
-
search,
|
|
54
|
-
searchContainer,
|
|
55
|
-
selected,
|
|
56
|
-
trigger,
|
|
57
|
-
triggerContent,
|
|
58
|
-
value
|
|
93
|
+
buildScatterOption
|
|
59
94
|
};
|
|
60
95
|
//# sourceMappingURL=index99.js.map
|
package/dist/index99.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index99.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index99.js","sources":["../src/charts/ScatterChartCard/buildScatterOption.ts"],"sourcesContent":["import type { FoldedPoint } from './foldPoints';\nimport { CHART_COLORS, SCATTER } from '../../constants';\n\n/** Distance from each axis line to its name (px — echarts canvas attributes, not CSS). */\nconst AXIS_NAME_GAP = { X: 28, Y: 38 } as const;\n\n/**\n * Grid margins (px). `containLabel` reserves room for the tick *labels* only, so\n * the axis names and the legend need their own margin or they get clipped at the\n * canvas edge. Each margin must exceed its `AXIS_NAME_GAP` by a text height.\n */\nconst GRID_MARGIN = {\n BASE: 8,\n TOP: 16,\n RIGHT: 16,\n X_NAME: 23,\n Y_NAME: 34,\n LEGEND: 30,\n} as const;\n\n/** Series name used when no point carries a category. */\nconst UNCATEGORISED_SERIES = 'Points';\n\nexport interface ScatterOptionConfig {\n xLabel?: string;\n yLabel?: string;\n categoryLabel?: string;\n showLegend: boolean;\n enableDataZoom: boolean;\n}\n\n/** Point labels come from consumer data and land in the tooltip's HTML. */\nconst escapeHtml = (value: string) =>\n value.replace(/[&<>\"]/g, (char) => `&#${char.charCodeAt(0)};`);\n\n/**\n * Map a weight onto a symbol diameter. The square root keeps the mark *area*\n * proportional to the weight, which is how a reader compares bubble sizes.\n * A dataset whose weights are all equal carries no size information, so it\n * renders at the base size rather than all-maximum.\n */\nconst symbolSizeFor = (weight: number, minWeight: number, maxWeight: number) => {\n if (maxWeight === minWeight) return SCATTER.BASE_SYMBOL_SIZE;\n\n const ratio = Math.sqrt((weight - minWeight) / (maxWeight - minWeight));\n return SCATTER.MIN_SYMBOL_SIZE + (SCATTER.MAX_SYMBOL_SIZE - SCATTER.MIN_SYMBOL_SIZE) * ratio;\n};\n\n/** Group marks by category, preserving first-appearance order. */\nconst groupByCategory = (points: FoldedPoint[]) => {\n const groups = new Map<string, FoldedPoint[]>();\n\n for (const folded of points) {\n const key = folded.point.category ?? UNCATEGORISED_SERIES;\n const group = groups.get(key);\n if (group) group.push(folded);\n else groups.set(key, [folded]);\n }\n\n return groups;\n};\n\n/** `[x, y, count, sourceIndex]` — dims beyond the axes carry the tooltip/click metadata. */\nconst toDataItem = (folded: FoldedPoint, sizeOf: (weight: number | null | undefined) => number) => ({\n name: folded.point.label,\n value: [folded.point.x, folded.point.y, folded.count, folded.index],\n symbolSize: sizeOf(folded.point.weight),\n});\n\nconst buildTooltipFormatter = (config: ScatterOptionConfig) => (params: unknown) => {\n const { name, seriesName, value, marker } = params as {\n name: string;\n seriesName: string;\n value: [number, number, number, number];\n marker: string;\n };\n const [x, y, count] = value;\n\n const lines = [`${marker} ${escapeHtml(name)}`];\n lines.push(`${escapeHtml(config.xLabel ?? 'x')}: ${x}`);\n lines.push(`${escapeHtml(config.yLabel ?? 'y')}: ${y}`);\n\n if (seriesName !== UNCATEGORISED_SERIES) {\n lines.push(`${escapeHtml(config.categoryLabel ?? 'Category')}: ${escapeHtml(seriesName)}`);\n }\n\n if (count > 1) lines.push(`${count} points here`);\n\n return lines.join('<br/>');\n};\n\nexport const buildScatterOption = (points: FoldedPoint[], config: ScatterOptionConfig) => {\n const weights = points.map((p) => p.point.weight).filter((w): w is number => w != null);\n const minWeight = weights.length > 0 ? Math.min(...weights) : 0;\n const maxWeight = weights.length > 0 ? Math.max(...weights) : 0;\n\n // An absent weight sits at the bottom of the scale once any weight is present,\n // and yields the base size when none is.\n const sizeOf = (weight: number | null | undefined) =>\n weights.length === 0\n ? SCATTER.BASE_SYMBOL_SIZE\n : symbolSizeFor(weight ?? minWeight, minWeight, maxWeight);\n\n const groups = groupByCategory(points);\n const series = [...groups.entries()].map(([category, group], i) => ({\n name: category,\n type: 'scatter' as const,\n data: group.map((folded) => toDataItem(folded, sizeOf)),\n itemStyle: { color: CHART_COLORS[i % CHART_COLORS.length], opacity: 0.85 },\n emphasis: { focus: 'series' as const },\n }));\n\n return {\n tooltip: { trigger: 'item' as const, formatter: buildTooltipFormatter(config) },\n legend: config.showLegend ? { bottom: 0, type: 'scroll' as const } : undefined,\n grid: {\n left: config.yLabel ? GRID_MARGIN.Y_NAME : GRID_MARGIN.BASE,\n right: GRID_MARGIN.RIGHT,\n top: GRID_MARGIN.TOP,\n // Room for the x axis name and the legend, each only when drawn.\n bottom:\n GRID_MARGIN.BASE +\n (config.xLabel ? GRID_MARGIN.X_NAME : 0) +\n (config.showLegend ? GRID_MARGIN.LEGEND : 0),\n containLabel: true,\n },\n xAxis: {\n type: 'value' as const,\n name: config.xLabel,\n nameLocation: 'middle' as const,\n nameGap: AXIS_NAME_GAP.X,\n scale: true,\n },\n yAxis: {\n type: 'value' as const,\n name: config.yLabel,\n nameLocation: 'middle' as const,\n // Without this the y name is drawn horizontally and eats the plot's width.\n nameRotate: 90,\n nameGap: AXIS_NAME_GAP.Y,\n scale: true,\n },\n dataZoom: config.enableDataZoom\n ? [\n { type: 'inside' as const, xAxisIndex: 0 },\n { type: 'inside' as const, yAxisIndex: 0 },\n ]\n : undefined,\n series,\n };\n};\n"],"names":[],"mappings":";AAIA,MAAM,gBAAgB,EAAE,GAAG,IAAI,GAAG,GAAA;AAOlC,MAAM,cAAc;AAAA,EAClB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;AAGA,MAAM,uBAAuB;AAW7B,MAAM,aAAa,CAAC,UAClB,MAAM,QAAQ,WAAW,CAAC,SAAS,KAAK,KAAK,WAAW,CAAC,CAAC,GAAG;AAQ/D,MAAM,gBAAgB,CAAC,QAAgB,WAAmB,cAAsB;AAC9E,MAAI,cAAc,UAAW,QAAO,QAAQ;AAE5C,QAAM,QAAQ,KAAK,MAAM,SAAS,cAAc,YAAY,UAAU;AACtE,SAAO,QAAQ,mBAAmB,QAAQ,kBAAkB,QAAQ,mBAAmB;AACzF;AAGA,MAAM,kBAAkB,CAAC,WAA0B;AACjD,QAAM,6BAAa,IAAA;AAEnB,aAAW,UAAU,QAAQ;AAC3B,UAAM,MAAM,OAAO,MAAM,YAAY;AACrC,UAAM,QAAQ,OAAO,IAAI,GAAG;AAC5B,QAAI,MAAO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
1580
1580
|
.krc-input--QI2U:focus {
|
|
1581
1581
|
border-color: var(--accent-color);
|
|
1582
1582
|
}
|
|
1583
|
+
/* Column flex so the map takes the height the card is given: the container grows
|
|
1584
|
+
when the consumer sizes the card, and falls back to its own height when the
|
|
1585
|
+
card is left to size itself. */
|
|
1586
|
+
.krc-root-m-WU1 {
|
|
1587
|
+
display: flex;
|
|
1588
|
+
flex-direction: column;
|
|
1589
|
+
background: var(--surface-color);
|
|
1590
|
+
border: var(--border-width) solid var(--border-color);
|
|
1591
|
+
border-radius: var(--radius-lg);
|
|
1592
|
+
box-shadow: var(--shadow-subtle);
|
|
1593
|
+
overflow: hidden;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
.krc-header-j8Yft {
|
|
1597
|
+
display: flex;
|
|
1598
|
+
flex: 0 0 auto;
|
|
1599
|
+
align-items: center;
|
|
1600
|
+
justify-content: space-between;
|
|
1601
|
+
padding: var(--spacing-sm) var(--spacing-md);
|
|
1602
|
+
border-bottom: var(--border-width) solid var(--border-color);
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
.krc-title-10Tak {
|
|
1606
|
+
margin: 0;
|
|
1607
|
+
font-size: var(--font-size-md);
|
|
1608
|
+
font-weight: 600;
|
|
1609
|
+
color: var(--text-primary);
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
.krc-headerActions-rh6MO {
|
|
1613
|
+
display: flex;
|
|
1614
|
+
align-items: center;
|
|
1615
|
+
gap: var(--spacing-xs);
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.krc-toolbar-6bfl- {
|
|
1619
|
+
display: flex;
|
|
1620
|
+
flex: 0 0 auto;
|
|
1621
|
+
align-items: center;
|
|
1622
|
+
gap: var(--spacing-md);
|
|
1623
|
+
padding: var(--spacing-xs) var(--spacing-md);
|
|
1624
|
+
border-bottom: var(--border-width) solid var(--border-color);
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
.krc-warning-dISP1 {
|
|
1628
|
+
display: flex;
|
|
1629
|
+
flex: 0 0 auto;
|
|
1630
|
+
align-items: center;
|
|
1631
|
+
gap: var(--spacing-xs);
|
|
1632
|
+
padding: var(--spacing-xs) var(--spacing-md);
|
|
1633
|
+
font-size: var(--font-size-xs);
|
|
1634
|
+
color: var(--warning-color);
|
|
1635
|
+
background: var(--warning-color-soft);
|
|
1636
|
+
border-bottom: var(--border-width) solid var(--border-color);
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/* An explicit height (not just a minimum) is what lets Leaflet resolve its own
|
|
1640
|
+
`height: 100%`; `flex: 1` then lets it take any extra space the card was given. */
|
|
1641
|
+
.krc-mapContainer-MKTII {
|
|
1642
|
+
position: relative;
|
|
1643
|
+
flex: 1 1 auto;
|
|
1644
|
+
box-sizing: border-box;
|
|
1645
|
+
height: 21.25rem;
|
|
1646
|
+
min-height: 21.25rem;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.krc-map-o-Ldd {
|
|
1650
|
+
width: 100%;
|
|
1651
|
+
height: 100%;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.krc-loading-LE2tH,
|
|
1655
|
+
.krc-empty-JAoUd {
|
|
1656
|
+
display: flex;
|
|
1657
|
+
flex: 1 1 auto;
|
|
1658
|
+
align-items: center;
|
|
1659
|
+
justify-content: center;
|
|
1660
|
+
min-height: 21.25rem;
|
|
1661
|
+
color: var(--text-secondary);
|
|
1662
|
+
font-size: var(--font-size-sm);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.krc-error-FkrvS {
|
|
1666
|
+
display: flex;
|
|
1667
|
+
flex: 1 1 auto;
|
|
1668
|
+
flex-direction: column;
|
|
1669
|
+
align-items: center;
|
|
1670
|
+
justify-content: center;
|
|
1671
|
+
gap: var(--spacing-sm);
|
|
1672
|
+
min-height: 21.25rem;
|
|
1673
|
+
color: var(--danger-color);
|
|
1674
|
+
font-size: var(--font-size-sm);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.krc-retryButton-BKn73 {
|
|
1678
|
+
padding: var(--spacing-xs) var(--spacing-md);
|
|
1679
|
+
font-size: var(--font-size-sm);
|
|
1680
|
+
color: var(--accent-color-contrast);
|
|
1681
|
+
background: var(--accent-color);
|
|
1682
|
+
border: none;
|
|
1683
|
+
border-radius: var(--radius-sm);
|
|
1684
|
+
cursor: pointer;
|
|
1685
|
+
transition: background-color 0.15s ease;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.krc-retryButton-BKn73:hover {
|
|
1689
|
+
background: var(--accent-color-strong);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
.krc-retryButton-BKn73:focus-visible {
|
|
1693
|
+
outline: none;
|
|
1694
|
+
box-shadow: var(--focus-ring-shadow);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/* The legend sits inside Leaflet's control pane (see MapLegend), so it inherits
|
|
1698
|
+
that stacking context and needs no z-index of its own. */
|
|
1699
|
+
.krc-legend-c-RjE {
|
|
1700
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
1701
|
+
background: var(--surface-color);
|
|
1702
|
+
border: var(--border-width) solid var(--border-color);
|
|
1703
|
+
border-radius: var(--radius-md);
|
|
1704
|
+
box-shadow: var(--shadow-soft);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
.krc-legendTitle-j4e4- {
|
|
1708
|
+
margin: 0 0 var(--spacing-2xs);
|
|
1709
|
+
font-size: var(--font-size-2xs);
|
|
1710
|
+
font-weight: 600;
|
|
1711
|
+
text-transform: uppercase;
|
|
1712
|
+
letter-spacing: 0.06em;
|
|
1713
|
+
color: var(--text-tertiary);
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.krc-legendList-jRukT {
|
|
1717
|
+
display: flex;
|
|
1718
|
+
flex-direction: column;
|
|
1719
|
+
gap: var(--spacing-2xs);
|
|
1720
|
+
margin: 0;
|
|
1721
|
+
padding: 0;
|
|
1722
|
+
list-style: none;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
.krc-legendItem-X2jYA {
|
|
1726
|
+
display: flex;
|
|
1727
|
+
align-items: center;
|
|
1728
|
+
gap: var(--spacing-xs);
|
|
1729
|
+
font-size: var(--font-size-xs);
|
|
1730
|
+
color: var(--text-secondary);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.krc-legendSwatch-OTMwM {
|
|
1734
|
+
flex: 0 0 auto;
|
|
1735
|
+
width: 0.625rem;
|
|
1736
|
+
height: 0.625rem;
|
|
1737
|
+
border-radius: var(--radius-pill);
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
/* Narrow containers (a chat dock is 20–47.5rem wide): the map must not push the
|
|
1741
|
+
surrounding content out of view. */
|
|
1742
|
+
.krc-compact-Ha6w2 .krc-mapContainer-MKTII,
|
|
1743
|
+
.krc-compact-Ha6w2 .krc-loading-LE2tH,
|
|
1744
|
+
.krc-compact-Ha6w2 .krc-empty-JAoUd,
|
|
1745
|
+
.krc-compact-Ha6w2 .krc-error-FkrvS {
|
|
1746
|
+
min-height: 13.75rem;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
.krc-compact-Ha6w2 .krc-mapContainer-MKTII {
|
|
1750
|
+
height: 13.75rem;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
.krc-compact-Ha6w2 .krc-header-j8Yft {
|
|
1754
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.krc-compact-Ha6w2 .krc-title-10Tak {
|
|
1758
|
+
font-size: var(--font-size-sm);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
/* Leaflet paints its own light-grey backdrop and near-black attribution text,
|
|
1762
|
+
which read as a hole in a dark surface while the tiles load. Scoped to this
|
|
1763
|
+
component and limited to colour — no layout of Leaflet's is touched. */
|
|
1764
|
+
.krc-root-m-WU1 .leaflet-container {
|
|
1765
|
+
background: var(--surface-alt);
|
|
1766
|
+
font-family: inherit;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
.krc-root-m-WU1 .leaflet-control-attribution {
|
|
1770
|
+
color: var(--text-tertiary);
|
|
1771
|
+
background: var(--surface-color);
|
|
1772
|
+
font-size: var(--font-size-2xs);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
.krc-root-m-WU1 .leaflet-control-attribution a {
|
|
1776
|
+
color: var(--text-secondary);
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
.krc-srOnly-KDwnO {
|
|
1780
|
+
position: absolute;
|
|
1781
|
+
width: var(--border-width);
|
|
1782
|
+
height: var(--border-width);
|
|
1783
|
+
margin: calc(-1 * var(--border-width));
|
|
1784
|
+
padding: 0;
|
|
1785
|
+
overflow: hidden;
|
|
1786
|
+
white-space: nowrap;
|
|
1787
|
+
border: 0;
|
|
1788
|
+
clip-path: inset(50%);
|
|
1789
|
+
}
|
|
1583
1790
|
.krc-wrap-JRsc1 {
|
|
1584
1791
|
overflow: auto;
|
|
1585
1792
|
border: var(--border-width) solid var(--border-color);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** A single plottable point on a map. The geographic mirror of `ScatterPoint`. */
|
|
2
|
+
export interface GeoPoint {
|
|
3
|
+
/** Stable identity: React key and selection value. */
|
|
4
|
+
id: string;
|
|
5
|
+
latitude: number;
|
|
6
|
+
longitude: number;
|
|
7
|
+
/** Tooltip text and accessible-listing label — what makes a point actionable. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Colour and legend dimension (zone, band, operator). */
|
|
10
|
+
category?: string | null;
|
|
11
|
+
/** Relative weight mapped to the marker radius (area ∝ weight). */
|
|
12
|
+
weight?: number | null;
|
|
13
|
+
/** Second tooltip line. */
|
|
14
|
+
detail?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** Point selection payload for map interaction callbacks. */
|
|
17
|
+
export interface GeoPointSelection {
|
|
18
|
+
point: GeoPoint;
|
|
19
|
+
/** Index in the original `points` array, not in the normalised one. */
|
|
20
|
+
index: number;
|
|
21
|
+
}
|
|
22
|
+
/** What the map declares about what it actually drew. */
|
|
23
|
+
export interface GeoRenderInfo {
|
|
24
|
+
/** Points received in `points`. */
|
|
25
|
+
total: number;
|
|
26
|
+
/** Markers drawn. */
|
|
27
|
+
drawn: number;
|
|
28
|
+
/** Points discarded for missing or out-of-range coordinates. */
|
|
29
|
+
skipped: number;
|
|
30
|
+
/** Points discarded by the `maxPoints` cap. */
|
|
31
|
+
dropped: number;
|
|
32
|
+
}
|
|
33
|
+
/** Basemap choice; `auto` follows the document theme. */
|
|
34
|
+
export type GeoBasemap = 'light' | 'dark' | 'auto';
|
|
35
|
+
/** A caller-supplied tile source, replacing the built-in basemaps. */
|
|
36
|
+
export interface GeoTileLayer {
|
|
37
|
+
url: string;
|
|
38
|
+
attribution: string;
|
|
39
|
+
}
|
|
40
|
+
/** One swatch of the map legend. */
|
|
41
|
+
export interface GeoLegendItem {
|
|
42
|
+
label: string;
|
|
43
|
+
color: string;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=geo.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo.types.d.ts","sourceRoot":"","sources":["../../src/types/geo.types.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,WAAW,QAAQ;IACvB,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,QAAQ,CAAC;IAChB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -50,5 +50,6 @@ export interface TemporalTrendPoint {
|
|
|
50
50
|
series: Record<string, number>;
|
|
51
51
|
}
|
|
52
52
|
export type { TimeRangeOption, ChartSeriesPoint, SankeyFlowRow as SankeyFlowRowV2, CounterTimeseriesPoint as CounterTimeseriesPointV2, DistinctCounterRow, ChartAnnotation as ChartAnnotationV2, ReferenceLine, EChartsInstance, ChartCategorySelection, SankeyColorMetric, SankeyWidthMetric, ChartSelectOption, ChartCardBaseProps, ScatterPoint, ScatterPointSelection, ScatterRenderInfo, } from './chart.types';
|
|
53
|
+
export type { GeoPoint, GeoPointSelection, GeoRenderInfo, GeoBasemap, GeoTileLayer, GeoLegendItem, } from './geo.types';
|
|
53
54
|
export type { NavItemConfig, SidebarSectionConfig, } from './layout.types';
|
|
54
55
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAGD,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,IAAI,eAAe,EAChC,sBAAsB,IAAI,wBAAwB,EAClD,kBAAkB,EAClB,eAAe,IAAI,iBAAiB,EACpC,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACV;AAED,gDAAgD;AAChD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qCAAqC;AACrC,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,iCAAiC;AACjC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,iCAAiC;AACjC,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAGD,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,IAAI,eAAe,EAChC,sBAAsB,IAAI,wBAAwB,EAClD,kBAAkB,EAClB,eAAe,IAAI,iBAAiB,EACpC,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ktnpm_devops/react-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Kenmei Technologies React Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,10 @@
|
|
|
37
37
|
"LICENSE"
|
|
38
38
|
],
|
|
39
39
|
"peerDependencies": {
|
|
40
|
+
"leaflet": "^1.9.0",
|
|
40
41
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
42
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
43
|
+
"react-leaflet": "^4.0.0 || ^5.0.0"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
44
46
|
"echarts": {
|
|
@@ -50,8 +52,14 @@
|
|
|
50
52
|
"@tanstack/react-table": {
|
|
51
53
|
"optional": true
|
|
52
54
|
},
|
|
55
|
+
"leaflet": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
53
58
|
"lucide-react": {
|
|
54
59
|
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"react-leaflet": {
|
|
62
|
+
"optional": true
|
|
55
63
|
}
|
|
56
64
|
},
|
|
57
65
|
"dependencies": {
|
|
@@ -68,6 +76,7 @@
|
|
|
68
76
|
"@testing-library/jest-dom": "^6.4.0",
|
|
69
77
|
"@testing-library/react": "^16.0.0",
|
|
70
78
|
"@testing-library/user-event": "^14.5.0",
|
|
79
|
+
"@types/leaflet": "^1.9.22",
|
|
71
80
|
"@types/react": "^19.2.18",
|
|
72
81
|
"@types/react-dom": "^19.2.4",
|
|
73
82
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
@@ -81,10 +90,12 @@
|
|
|
81
90
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
82
91
|
"eslint-plugin-storybook": "^0.8.0",
|
|
83
92
|
"happy-dom": "^14.0.0",
|
|
93
|
+
"leaflet": "^1.9.4",
|
|
84
94
|
"lucide-react": "^0.441.0",
|
|
85
95
|
"prettier": "^3.2.0",
|
|
86
96
|
"react": "^19.2.8",
|
|
87
97
|
"react-dom": "^19.2.8",
|
|
98
|
+
"react-leaflet": "^5.0.0",
|
|
88
99
|
"storybook": "^8.4.0",
|
|
89
100
|
"typescript": "^5.4.4",
|
|
90
101
|
"vite": "^5.2.8",
|
|
@@ -99,6 +110,9 @@
|
|
|
99
110
|
"type": "git",
|
|
100
111
|
"url": "https://github.com/kenmeitechnologies/react-component.git"
|
|
101
112
|
},
|
|
113
|
+
"engines": {
|
|
114
|
+
"node": ">=22"
|
|
115
|
+
},
|
|
102
116
|
"scripts": {
|
|
103
117
|
"dev": "storybook dev -p 6006",
|
|
104
118
|
"build": "vite build && pnpm build:css",
|