@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/index9.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index9.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index9.cjs","sources":["../src/utils/chartExport.ts"],"sourcesContent":["export type TableData = Array<Array<string | number>>;\n\nconst ensureString = (value: string | number): string =>\n value === null || value === undefined ? '' : String(value);\n\nexport const toStringTable = (table: TableData): string[][] =>\n table.map((row) => row.map((cell) => ensureString(cell)));\n\nexport const sanitizeFilename = (value: string): string => {\n const normalized = value\n .normalize()\n .replace(/[^\\p{L}\\p{N}]+/gu, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase();\n return normalized || 'export';\n};\n\nconst buildCsv = (table: TableData): string => {\n const rows = toStringTable(table);\n return rows\n .map((row) =>\n row\n .map((cell) => {\n const escaped = cell.replace(/\"/g, '\"\"');\n return /[\",\\n]/.test(escaped) ? `\"${escaped}\"` : escaped;\n })\n .join(','),\n )\n .join('\\r\\n');\n};\n\nconst triggerDownload = (blob: Blob, filename: string) => {\n const link = document.createElement('a');\n const url = URL.createObjectURL(blob);\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n};\n\nexport const exportTableToCsv = (table: TableData, filename: string) => {\n if (table.length === 0) return;\n const csv = buildCsv(table);\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });\n const finalName = filename.endsWith('.csv') ? filename : `${filename}.csv`;\n triggerDownload(blob, finalName);\n};\n\nexport const getChartPngDataUrl = (chart: { getDataURL: (opts: Record<string, unknown>) => string }): string =>\n chart.getDataURL({ type: 'png', pixelRatio: 2, backgroundColor: '#ffffff' });\n\nexport const downloadImageDataUrl = (dataUrl: string, filename: string) => {\n const link = document.createElement('a');\n link.href = dataUrl;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n};\n\nconst buildTableHtml = (table: TableData): string => {\n const rows = toStringTable(table);\n if (rows.length === 0) return '';\n const [header, ...body] = rows;\n const thead = `<thead><tr>${header.map((c) => `<th>${c}</th>`).join('')}</tr></thead>`;\n const tbody = body.map((r) => `<tr>${r.map((c) => `<td>${c}</td>`).join('')}</tr>`).join('');\n return `<table>${thead}<tbody>${tbody}</tbody></table>`;\n};\n\nexport const openPrintWindowWithChart = (title: string, chartDataUrl: string, table: TableData) => {\n const win = window.open('', '_blank');\n if (!win) return;\n const tableHtml = buildTableHtml(table);\n win.document.write('<!DOCTYPE html>');\n win.document.write(`<html><head><title>${title}</title>`);\n win.document.write(\n '<style>body{font-family:Arial,Helvetica,sans-serif;padding:24px;color:#1f2937;}h1{font-size:20px;margin-bottom:16px;}img{max-width:100%;height:auto;margin-bottom:16px;border:1px solid #e5e7eb;border-radius:12px;}table{border-collapse:collapse;width:100%;}th,td{border:1px solid #d1d5db;padding:8px;text-align:left;font-size:12px;}th{background:#f3f4f6;text-transform:uppercase;letter-spacing:0.05em;font-weight:600;}</style>',\n );\n win.document.write('</head><body>');\n win.document.write(`<h1>${title}</h1>`);\n win.document.write(`<img src=\"${chartDataUrl}\" alt=\"${title}\" />`);\n win.document.write(tableHtml);\n win.document.write('</body></html>');\n win.document.close();\n win.focus();\n setTimeout(() => win.print(), 300);\n};\n\nexport const composeFilename = (title: string, suffix?: string) => {\n const base = sanitizeFilename(title);\n if (suffix && suffix.trim().length > 0) {\n const suffixSanitized = sanitizeFilename(suffix);\n return suffixSanitized ? `${base}-${suffixSanitized}` : base;\n }\n return base;\n};\n"],"names":[],"mappings":";;AAEA,MAAM,eAAe,CAAC,UACpB,UAAU,QAAQ,UAAU,SAAY,KAAK,OAAO,KAAK;AAEpD,MAAM,gBAAgB,CAAC,UAC5B,MAAM,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,CAAC;AAEnD,MAAM,mBAAmB,CAAC,UAA0B;AACzD,QAAM,aAAa,MAChB,UAAA,EACA,QAAQ,oBAAoB,GAAG,EAC/B,QAAQ,YAAY,EAAE,EACtB,YAAA;AACH,SAAO,cAAc;AACvB;AAEA,MAAM,WAAW,CAAC,UAA6B;AAC7C,QAAM,OAAO,cAAc,KAAK;AAChC,SAAO,KACJ;AAAA,IAAI,CAAC,QACJ,IACG,IAAI,CAAC,SAAS;AACb,YAAM,UAAU,KAAK,QAAQ,MAAM,IAAI;AACvC,aAAO,SAAS,KAAK,OAAO,IAAI,IAAI,OAAO,MAAM;AAAA,IACnD,CAAC,EACA,KAAK,GAAG;AAAA,EAAA,EAEZ,KAAK,MAAM;AAChB;AAEA,MAAM,kBAAkB,CAAC,MAAY,aAAqB;AACxD,QAAM,OAAO,SAAS,cAAc,GAAG;AACvC,QAAM,MAAM,IAAI,gBAAgB,IAAI;AACp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null || value === void 0 ? "" : String(value);
|
|
2
|
+
const toStringTable = (table) => table.map((row) => row.map((cell) => ensureString(cell)));
|
|
3
|
+
const sanitizeFilename = (value) => {
|
|
4
|
+
const normalized = value.normalize().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
5
|
+
return normalized || "export";
|
|
6
|
+
};
|
|
7
|
+
const buildCsv = (table) => {
|
|
8
|
+
const rows = toStringTable(table);
|
|
9
|
+
return rows.map(
|
|
10
|
+
(row) => row.map((cell) => {
|
|
11
|
+
const escaped = cell.replace(/"/g, '""');
|
|
12
|
+
return /[",\n]/.test(escaped) ? `"${escaped}"` : escaped;
|
|
13
|
+
}).join(",")
|
|
14
|
+
).join("\r\n");
|
|
15
|
+
};
|
|
16
|
+
const triggerDownload = (blob, filename) => {
|
|
17
|
+
const link = document.createElement("a");
|
|
18
|
+
const url = URL.createObjectURL(blob);
|
|
19
|
+
link.href = url;
|
|
20
|
+
link.download = filename;
|
|
21
|
+
document.body.appendChild(link);
|
|
22
|
+
link.click();
|
|
23
|
+
document.body.removeChild(link);
|
|
24
|
+
URL.revokeObjectURL(url);
|
|
25
|
+
};
|
|
26
|
+
const exportTableToCsv = (table, filename) => {
|
|
27
|
+
if (table.length === 0) return;
|
|
28
|
+
const csv = buildCsv(table);
|
|
29
|
+
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
30
|
+
const finalName = filename.endsWith(".csv") ? filename : `${filename}.csv`;
|
|
31
|
+
triggerDownload(blob, finalName);
|
|
32
|
+
};
|
|
33
|
+
const getChartPngDataUrl = (chart) => chart.getDataURL({ type: "png", pixelRatio: 2, backgroundColor: "#ffffff" });
|
|
34
|
+
const downloadImageDataUrl = (dataUrl, filename) => {
|
|
35
|
+
const link = document.createElement("a");
|
|
36
|
+
link.href = dataUrl;
|
|
37
|
+
link.download = filename;
|
|
38
|
+
document.body.appendChild(link);
|
|
39
|
+
link.click();
|
|
40
|
+
document.body.removeChild(link);
|
|
41
|
+
};
|
|
42
|
+
const buildTableHtml = (table) => {
|
|
43
|
+
const rows = toStringTable(table);
|
|
44
|
+
if (rows.length === 0) return "";
|
|
45
|
+
const [header, ...body] = rows;
|
|
46
|
+
const thead = `<thead><tr>${header.map((c) => `<th>${c}</th>`).join("")}</tr></thead>`;
|
|
47
|
+
const tbody = body.map((r) => `<tr>${r.map((c) => `<td>${c}</td>`).join("")}</tr>`).join("");
|
|
48
|
+
return `<table>${thead}<tbody>${tbody}</tbody></table>`;
|
|
49
|
+
};
|
|
50
|
+
const openPrintWindowWithChart = (title, chartDataUrl, table) => {
|
|
51
|
+
const win = window.open("", "_blank");
|
|
52
|
+
if (!win) return;
|
|
53
|
+
const tableHtml = buildTableHtml(table);
|
|
54
|
+
win.document.write("<!DOCTYPE html>");
|
|
55
|
+
win.document.write(`<html><head><title>${title}</title>`);
|
|
56
|
+
win.document.write(
|
|
57
|
+
"<style>body{font-family:Arial,Helvetica,sans-serif;padding:24px;color:#1f2937;}h1{font-size:20px;margin-bottom:16px;}img{max-width:100%;height:auto;margin-bottom:16px;border:1px solid #e5e7eb;border-radius:12px;}table{border-collapse:collapse;width:100%;}th,td{border:1px solid #d1d5db;padding:8px;text-align:left;font-size:12px;}th{background:#f3f4f6;text-transform:uppercase;letter-spacing:0.05em;font-weight:600;}</style>"
|
|
58
|
+
);
|
|
59
|
+
win.document.write("</head><body>");
|
|
60
|
+
win.document.write(`<h1>${title}</h1>`);
|
|
61
|
+
win.document.write(`<img src="${chartDataUrl}" alt="${title}" />`);
|
|
62
|
+
win.document.write(tableHtml);
|
|
63
|
+
win.document.write("</body></html>");
|
|
64
|
+
win.document.close();
|
|
65
|
+
win.focus();
|
|
66
|
+
setTimeout(() => win.print(), 300);
|
|
67
|
+
};
|
|
68
|
+
const composeFilename = (title, suffix) => {
|
|
69
|
+
const base = sanitizeFilename(title);
|
|
70
|
+
if (suffix && suffix.trim().length > 0) {
|
|
71
|
+
const suffixSanitized = sanitizeFilename(suffix);
|
|
72
|
+
return `${base}-${suffixSanitized}`;
|
|
42
73
|
}
|
|
43
|
-
|
|
44
|
-
|
|
74
|
+
return base;
|
|
75
|
+
};
|
|
45
76
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
77
|
+
composeFilename,
|
|
78
|
+
downloadImageDataUrl,
|
|
79
|
+
exportTableToCsv,
|
|
80
|
+
getChartPngDataUrl,
|
|
81
|
+
openPrintWindowWithChart,
|
|
82
|
+
sanitizeFilename,
|
|
83
|
+
toStringTable
|
|
48
84
|
};
|
|
49
85
|
//# sourceMappingURL=index9.js.map
|
package/dist/index9.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index9.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index9.js","sources":["../src/utils/chartExport.ts"],"sourcesContent":["export type TableData = Array<Array<string | number>>;\n\nconst ensureString = (value: string | number): string =>\n value === null || value === undefined ? '' : String(value);\n\nexport const toStringTable = (table: TableData): string[][] =>\n table.map((row) => row.map((cell) => ensureString(cell)));\n\nexport const sanitizeFilename = (value: string): string => {\n const normalized = value\n .normalize()\n .replace(/[^\\p{L}\\p{N}]+/gu, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase();\n return normalized || 'export';\n};\n\nconst buildCsv = (table: TableData): string => {\n const rows = toStringTable(table);\n return rows\n .map((row) =>\n row\n .map((cell) => {\n const escaped = cell.replace(/\"/g, '\"\"');\n return /[\",\\n]/.test(escaped) ? `\"${escaped}\"` : escaped;\n })\n .join(','),\n )\n .join('\\r\\n');\n};\n\nconst triggerDownload = (blob: Blob, filename: string) => {\n const link = document.createElement('a');\n const url = URL.createObjectURL(blob);\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n};\n\nexport const exportTableToCsv = (table: TableData, filename: string) => {\n if (table.length === 0) return;\n const csv = buildCsv(table);\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });\n const finalName = filename.endsWith('.csv') ? filename : `${filename}.csv`;\n triggerDownload(blob, finalName);\n};\n\nexport const getChartPngDataUrl = (chart: { getDataURL: (opts: Record<string, unknown>) => string }): string =>\n chart.getDataURL({ type: 'png', pixelRatio: 2, backgroundColor: '#ffffff' });\n\nexport const downloadImageDataUrl = (dataUrl: string, filename: string) => {\n const link = document.createElement('a');\n link.href = dataUrl;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n};\n\nconst buildTableHtml = (table: TableData): string => {\n const rows = toStringTable(table);\n if (rows.length === 0) return '';\n const [header, ...body] = rows;\n const thead = `<thead><tr>${header.map((c) => `<th>${c}</th>`).join('')}</tr></thead>`;\n const tbody = body.map((r) => `<tr>${r.map((c) => `<td>${c}</td>`).join('')}</tr>`).join('');\n return `<table>${thead}<tbody>${tbody}</tbody></table>`;\n};\n\nexport const openPrintWindowWithChart = (title: string, chartDataUrl: string, table: TableData) => {\n const win = window.open('', '_blank');\n if (!win) return;\n const tableHtml = buildTableHtml(table);\n win.document.write('<!DOCTYPE html>');\n win.document.write(`<html><head><title>${title}</title>`);\n win.document.write(\n '<style>body{font-family:Arial,Helvetica,sans-serif;padding:24px;color:#1f2937;}h1{font-size:20px;margin-bottom:16px;}img{max-width:100%;height:auto;margin-bottom:16px;border:1px solid #e5e7eb;border-radius:12px;}table{border-collapse:collapse;width:100%;}th,td{border:1px solid #d1d5db;padding:8px;text-align:left;font-size:12px;}th{background:#f3f4f6;text-transform:uppercase;letter-spacing:0.05em;font-weight:600;}</style>',\n );\n win.document.write('</head><body>');\n win.document.write(`<h1>${title}</h1>`);\n win.document.write(`<img src=\"${chartDataUrl}\" alt=\"${title}\" />`);\n win.document.write(tableHtml);\n win.document.write('</body></html>');\n win.document.close();\n win.focus();\n setTimeout(() => win.print(), 300);\n};\n\nexport const composeFilename = (title: string, suffix?: string) => {\n const base = sanitizeFilename(title);\n if (suffix && suffix.trim().length > 0) {\n const suffixSanitized = sanitizeFilename(suffix);\n return su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AG;AACnC;AAEO,MAAM,kBAAkB,CAAC,OAAe,WAAoB;AACjE,QAAM,OAAO,iBAAiB,KAAK;AACnC,MAAI,UAAU,OAAO,KAAA,EAAO,SAAS,GAAG;AACtC,UAAM,kBAAkB,iBAAiB,MAAM;AAC/C,WAAyB,GAAG,IAAI,IAAI,eAAe;AAAA,EACrD;AACA,SAAO;AACT;"}
|
package/dist/index90.cjs
CHANGED
|
@@ -1,118 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const otherMap = /* @__PURE__ */ new Map();
|
|
25
|
-
for (const [, points] of rest) {
|
|
26
|
-
for (const p of points) {
|
|
27
|
-
otherMap.set(p.ts, (otherMap.get(p.ts) ?? 0) + p.value);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const otherPoints = [...otherMap.entries()].map(([ts, value]) => ({
|
|
31
|
-
ts,
|
|
32
|
-
value
|
|
33
|
-
}));
|
|
34
|
-
return [...top, ["Other", otherPoints]];
|
|
35
|
-
}
|
|
36
|
-
function buildMarkAreas(annotations) {
|
|
37
|
-
return annotations.filter((a) => a.end).map((a) => [
|
|
38
|
-
{
|
|
39
|
-
name: a.label,
|
|
40
|
-
xAxis: a.start,
|
|
41
|
-
itemStyle: { color: a.color ?? "rgba(255,107,90,0.1)" }
|
|
42
|
-
},
|
|
43
|
-
{ xAxis: a.end }
|
|
44
|
-
]);
|
|
45
|
-
}
|
|
46
|
-
function buildMarkLines(annotations) {
|
|
47
|
-
return annotations.filter((a) => !a.end).map((a) => ({
|
|
48
|
-
name: a.label,
|
|
49
|
-
xAxis: a.start,
|
|
50
|
-
lineStyle: { color: a.color ?? constants.CHART_COLORS[0], type: "dashed" },
|
|
51
|
-
label: { formatter: a.label, position: "end" }
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
function buildReferenceLines(referenceLines) {
|
|
55
|
-
return referenceLines.map((r) => ({
|
|
56
|
-
name: r.label ?? String(r.value),
|
|
57
|
-
yAxis: r.value,
|
|
58
|
-
lineStyle: {
|
|
59
|
-
color: r.color ?? constants.CHART_COLORS[0],
|
|
60
|
-
type: r.dashed === false ? "solid" : "dashed"
|
|
61
|
-
},
|
|
62
|
-
label: {
|
|
63
|
-
formatter: r.label ?? String(r.value),
|
|
64
|
-
position: "insideEndTop"
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
function buildLegendSelected(seriesGroups, hiddenSeries) {
|
|
69
|
-
if (!hiddenSeries) return void 0;
|
|
70
|
-
const hidden = hiddenSeries instanceof Set ? hiddenSeries : new Set(hiddenSeries);
|
|
71
|
-
return Object.fromEntries(seriesGroups.map(([name]) => [name, !hidden.has(name)]));
|
|
72
|
-
}
|
|
73
|
-
function buildTemporalTrendOption(seriesGroups, config) {
|
|
74
|
-
const markAreas = buildMarkAreas(config.annotations);
|
|
75
|
-
const markLines = [
|
|
76
|
-
...buildMarkLines(config.annotations),
|
|
77
|
-
...buildReferenceLines(config.referenceLines)
|
|
78
|
-
];
|
|
79
|
-
const series = seriesGroups.map(([name, points], idx) => ({
|
|
80
|
-
name,
|
|
81
|
-
type: "line",
|
|
82
|
-
...config.stacked ? { stack: "total", areaStyle: {} } : {},
|
|
83
|
-
emphasis: { focus: "series" },
|
|
84
|
-
color: constants.CHART_COLORS[idx % constants.CHART_COLORS.length],
|
|
85
|
-
data: points.sort((a, b) => a.ts < b.ts ? -1 : 1).map((p) => [p.ts, p.value]),
|
|
86
|
-
...idx === 0 && (markAreas.length > 0 || markLines.length > 0) ? {
|
|
87
|
-
markArea: markAreas.length > 0 ? { silent: true, data: markAreas } : void 0,
|
|
88
|
-
markLine: markLines.length > 0 ? { silent: true, symbol: "none", data: markLines } : void 0
|
|
89
|
-
} : {}
|
|
90
|
-
}));
|
|
91
|
-
return {
|
|
92
|
-
tooltip: {
|
|
93
|
-
trigger: "axis",
|
|
94
|
-
axisPointer: { type: "cross" }
|
|
95
|
-
},
|
|
96
|
-
legend: {
|
|
97
|
-
show: config.showLegend,
|
|
98
|
-
type: "scroll",
|
|
99
|
-
bottom: 0,
|
|
100
|
-
selected: buildLegendSelected(seriesGroups, config.hiddenSeries)
|
|
101
|
-
},
|
|
102
|
-
grid: {
|
|
103
|
-
left: "3%",
|
|
104
|
-
right: "4%",
|
|
105
|
-
bottom: config.showLegend ? "15%" : "3%",
|
|
106
|
-
containLabel: true
|
|
107
|
-
},
|
|
108
|
-
xAxis: { type: "time" },
|
|
109
|
-
yAxis: { type: "value" },
|
|
110
|
-
series
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
exports.buildMarkAreas = buildMarkAreas;
|
|
114
|
-
exports.buildMarkLines = buildMarkLines;
|
|
115
|
-
exports.buildReferenceLines = buildReferenceLines;
|
|
116
|
-
exports.buildTemporalTrendOption = buildTemporalTrendOption;
|
|
117
|
-
exports.groupByCategory = groupByCategory;
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const root = "krc-root-pS02L";
|
|
4
|
+
const sidebar = "krc-sidebar-n1HeR";
|
|
5
|
+
const conversationList = "krc-conversationList-E8ODD";
|
|
6
|
+
const mainArea = "krc-mainArea-E0cNf";
|
|
7
|
+
const messages = "krc-messages-S9aU-";
|
|
8
|
+
const input = "krc-input-HAMJ3";
|
|
9
|
+
const styles = {
|
|
10
|
+
root,
|
|
11
|
+
sidebar,
|
|
12
|
+
conversationList,
|
|
13
|
+
mainArea,
|
|
14
|
+
messages,
|
|
15
|
+
input
|
|
16
|
+
};
|
|
17
|
+
exports.conversationList = conversationList;
|
|
18
|
+
exports.default = styles;
|
|
19
|
+
exports.input = input;
|
|
20
|
+
exports.mainArea = mainArea;
|
|
21
|
+
exports.messages = messages;
|
|
22
|
+
exports.root = root;
|
|
23
|
+
exports.sidebar = sidebar;
|
|
118
24
|
//# sourceMappingURL=index90.cjs.map
|
package/dist/index90.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index90.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"index90.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index90.js
CHANGED
|
@@ -1,118 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(a, b) => b[1].reduce((sum, p) => sum + p.value, 0) - a[1].reduce((sum, p) => sum + p.value, 0)
|
|
16
|
-
);
|
|
17
|
-
if (entries.length <= limit) {
|
|
18
|
-
return entries;
|
|
19
|
-
}
|
|
20
|
-
const top = entries.slice(0, limit - 1);
|
|
21
|
-
const rest = entries.slice(limit - 1);
|
|
22
|
-
const otherMap = /* @__PURE__ */ new Map();
|
|
23
|
-
for (const [, points] of rest) {
|
|
24
|
-
for (const p of points) {
|
|
25
|
-
otherMap.set(p.ts, (otherMap.get(p.ts) ?? 0) + p.value);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const otherPoints = [...otherMap.entries()].map(([ts, value]) => ({
|
|
29
|
-
ts,
|
|
30
|
-
value
|
|
31
|
-
}));
|
|
32
|
-
return [...top, ["Other", otherPoints]];
|
|
33
|
-
}
|
|
34
|
-
function buildMarkAreas(annotations) {
|
|
35
|
-
return annotations.filter((a) => a.end).map((a) => [
|
|
36
|
-
{
|
|
37
|
-
name: a.label,
|
|
38
|
-
xAxis: a.start,
|
|
39
|
-
itemStyle: { color: a.color ?? "rgba(255,107,90,0.1)" }
|
|
40
|
-
},
|
|
41
|
-
{ xAxis: a.end }
|
|
42
|
-
]);
|
|
43
|
-
}
|
|
44
|
-
function buildMarkLines(annotations) {
|
|
45
|
-
return annotations.filter((a) => !a.end).map((a) => ({
|
|
46
|
-
name: a.label,
|
|
47
|
-
xAxis: a.start,
|
|
48
|
-
lineStyle: { color: a.color ?? CHART_COLORS[0], type: "dashed" },
|
|
49
|
-
label: { formatter: a.label, position: "end" }
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
function buildReferenceLines(referenceLines) {
|
|
53
|
-
return referenceLines.map((r) => ({
|
|
54
|
-
name: r.label ?? String(r.value),
|
|
55
|
-
yAxis: r.value,
|
|
56
|
-
lineStyle: {
|
|
57
|
-
color: r.color ?? CHART_COLORS[0],
|
|
58
|
-
type: r.dashed === false ? "solid" : "dashed"
|
|
59
|
-
},
|
|
60
|
-
label: {
|
|
61
|
-
formatter: r.label ?? String(r.value),
|
|
62
|
-
position: "insideEndTop"
|
|
63
|
-
}
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
function buildLegendSelected(seriesGroups, hiddenSeries) {
|
|
67
|
-
if (!hiddenSeries) return void 0;
|
|
68
|
-
const hidden = hiddenSeries instanceof Set ? hiddenSeries : new Set(hiddenSeries);
|
|
69
|
-
return Object.fromEntries(seriesGroups.map(([name]) => [name, !hidden.has(name)]));
|
|
70
|
-
}
|
|
71
|
-
function buildTemporalTrendOption(seriesGroups, config) {
|
|
72
|
-
const markAreas = buildMarkAreas(config.annotations);
|
|
73
|
-
const markLines = [
|
|
74
|
-
...buildMarkLines(config.annotations),
|
|
75
|
-
...buildReferenceLines(config.referenceLines)
|
|
76
|
-
];
|
|
77
|
-
const series = seriesGroups.map(([name, points], idx) => ({
|
|
78
|
-
name,
|
|
79
|
-
type: "line",
|
|
80
|
-
...config.stacked ? { stack: "total", areaStyle: {} } : {},
|
|
81
|
-
emphasis: { focus: "series" },
|
|
82
|
-
color: CHART_COLORS[idx % CHART_COLORS.length],
|
|
83
|
-
data: points.sort((a, b) => a.ts < b.ts ? -1 : 1).map((p) => [p.ts, p.value]),
|
|
84
|
-
...idx === 0 && (markAreas.length > 0 || markLines.length > 0) ? {
|
|
85
|
-
markArea: markAreas.length > 0 ? { silent: true, data: markAreas } : void 0,
|
|
86
|
-
markLine: markLines.length > 0 ? { silent: true, symbol: "none", data: markLines } : void 0
|
|
87
|
-
} : {}
|
|
88
|
-
}));
|
|
89
|
-
return {
|
|
90
|
-
tooltip: {
|
|
91
|
-
trigger: "axis",
|
|
92
|
-
axisPointer: { type: "cross" }
|
|
93
|
-
},
|
|
94
|
-
legend: {
|
|
95
|
-
show: config.showLegend,
|
|
96
|
-
type: "scroll",
|
|
97
|
-
bottom: 0,
|
|
98
|
-
selected: buildLegendSelected(seriesGroups, config.hiddenSeries)
|
|
99
|
-
},
|
|
100
|
-
grid: {
|
|
101
|
-
left: "3%",
|
|
102
|
-
right: "4%",
|
|
103
|
-
bottom: config.showLegend ? "15%" : "3%",
|
|
104
|
-
containLabel: true
|
|
105
|
-
},
|
|
106
|
-
xAxis: { type: "time" },
|
|
107
|
-
yAxis: { type: "value" },
|
|
108
|
-
series
|
|
109
|
-
};
|
|
110
|
-
}
|
|
1
|
+
const root = "krc-root-pS02L";
|
|
2
|
+
const sidebar = "krc-sidebar-n1HeR";
|
|
3
|
+
const conversationList = "krc-conversationList-E8ODD";
|
|
4
|
+
const mainArea = "krc-mainArea-E0cNf";
|
|
5
|
+
const messages = "krc-messages-S9aU-";
|
|
6
|
+
const input = "krc-input-HAMJ3";
|
|
7
|
+
const styles = {
|
|
8
|
+
root,
|
|
9
|
+
sidebar,
|
|
10
|
+
conversationList,
|
|
11
|
+
mainArea,
|
|
12
|
+
messages,
|
|
13
|
+
input
|
|
14
|
+
};
|
|
111
15
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
16
|
+
conversationList,
|
|
17
|
+
styles as default,
|
|
18
|
+
input,
|
|
19
|
+
mainArea,
|
|
20
|
+
messages,
|
|
21
|
+
root,
|
|
22
|
+
sidebar
|
|
117
23
|
};
|
|
118
24
|
//# sourceMappingURL=index90.js.map
|
package/dist/index90.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index90.js","sources":[
|
|
1
|
+
{"version":3,"file":"index90.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|