@tsingroc/tsingroc-components 5.0.0-alpha.27 → 5.0.2

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 (80) hide show
  1. package/dist/components/{AutoResizedECharts.d.ts → AutoResizedECharts/index.d.ts} +2 -2
  2. package/dist/components/{AutoResizedECharts.js → AutoResizedECharts/index.js} +2 -2
  3. package/dist/components/{Calendar.js → Calendar/index.js} +8 -8
  4. package/dist/components/{ConnectedECharts.d.ts → ConnectedECharts/index.d.ts} +2 -2
  5. package/dist/components/{ConnectedECharts.js → ConnectedECharts/index.js} +1 -1
  6. package/dist/components/ECharts/Wrapper.d.ts +5 -0
  7. package/dist/components/ECharts/Wrapper.js +16 -0
  8. package/dist/components/{ECharts.d.ts → ECharts/index.d.ts} +4 -1
  9. package/dist/components/{ECharts.js → ECharts/index.js} +2 -5
  10. package/dist/components/{Header.js → Header/index.js} +3 -3
  11. package/dist/components/{LeftAlignedECharts.d.ts → LeftAlignedECharts/index.d.ts} +2 -2
  12. package/dist/components/{LeftAlignedECharts.js → LeftAlignedECharts/index.js} +3 -3
  13. package/dist/components/{LineChartEditor.js → LineChartEditor/index.js} +3 -6
  14. package/dist/components/{LineChartTable.js → LineChartTable/index.js} +2 -2
  15. package/dist/components/{LinkedLineChart.d.ts → LinkedLineChart/index.d.ts} +1 -1
  16. package/dist/components/{LinkedLineChart.js → LinkedLineChart/index.js} +5 -2
  17. package/dist/components/{QuickDateRangePicker.js → QuickDateRangePicker/index.js} +6 -6
  18. package/dist/components/{SegmentedButtons.js → SegmentedButtons/index.js} +0 -2
  19. package/dist/components/{SelectableECharts.d.ts → SelectableECharts/index.d.ts} +11 -3
  20. package/dist/components/{SelectableECharts.js → SelectableECharts/index.js} +7 -4
  21. package/dist/components/{Sidebar.js → Sidebar/index.js} +3 -3
  22. package/dist/components/{TsingrocDatePicker.js → TsingrocDatePicker/index.js} +5 -5
  23. package/dist/components/{UserButton.js → UserButton/index.js} +3 -3
  24. package/dist/components/auth/AuthProvider.d.ts +39 -8
  25. package/dist/components/auth/AuthProvider.js +24 -1
  26. package/dist/components/auth/AuthService.d.ts +3 -0
  27. package/dist/components/auth/{CasdoorAuth.d.ts → CasdoorAuth/index.d.ts} +20 -3
  28. package/dist/components/auth/{CasdoorAuth.js → CasdoorAuth/index.js} +3 -3
  29. package/dist/components/auth/{EmbeddedAuth.d.ts → EmbeddedAuth/index.d.ts} +8 -3
  30. package/dist/components/auth/{EmbeddedAuth.js → EmbeddedAuth/index.js} +3 -3
  31. package/dist/components/auth/{LocalAuth.d.ts → LocalAuth/index.d.ts} +12 -3
  32. package/dist/components/auth/{LocalAuth.js → LocalAuth/index.js} +2 -2
  33. package/dist/components/auth/LoginCheck.d.ts +16 -0
  34. package/dist/components/auth/LoginCheck.js +5 -0
  35. package/dist/components/auth/SessionStore.d.ts +16 -4
  36. package/dist/components/auth/SessionStore.js +1 -1
  37. package/dist/components/auth/Wrappers.d.ts +37 -0
  38. package/dist/components/auth/Wrappers.js +68 -0
  39. package/dist/echarts/Wrappers.d.ts +34 -0
  40. package/dist/echarts/Wrappers.js +76 -0
  41. package/dist/echarts/coordinateSystems/Wrappers.d.ts +10 -0
  42. package/dist/echarts/coordinateSystems/Wrappers.js +31 -0
  43. package/dist/echarts/gl.js +3 -4
  44. package/dist/echarts/index.js +1 -1
  45. package/dist/echarts/series/Wrappers.d.ts +31 -0
  46. package/dist/echarts/series/Wrappers.js +102 -0
  47. package/dist/echarts/series/boxplotSeries.js +0 -2
  48. package/dist/echarts/series/intervalSeries.js +0 -1
  49. package/dist/echarts/series/maxBarSeries.js +0 -1
  50. package/dist/index.d.ts +0 -1
  51. package/dist/index.js +1 -2
  52. package/dist/utils/destructureLineDataItem.js +1 -2
  53. package/package.json +41 -34
  54. package/dist/components/VerticalColorLegend.d.ts +0 -7
  55. package/dist/components/VerticalColorLegend.js +0 -208
  56. package/dist/components/WeatherMap.d.ts +0 -18
  57. package/dist/components/WeatherMap.js +0 -658
  58. package/dist/deckgl/TiandituLayer.d.ts +0 -13
  59. package/dist/deckgl/TiandituLayer.js +0 -44
  60. package/dist/deckgl/WeatherData.d.ts +0 -53
  61. package/dist/deckgl/WeatherData.js +0 -94
  62. package/dist/deckgl/index.d.ts +0 -1
  63. package/dist/deckgl/index.js +0 -1
  64. /package/dist/components/{Calendar.d.ts → Calendar/index.d.ts} +0 -0
  65. /package/dist/components/{CircularProgress.d.ts → CircularProgress/index.d.ts} +0 -0
  66. /package/dist/components/{CircularProgress.js → CircularProgress/index.js} +0 -0
  67. /package/dist/components/{Header.d.ts → Header/index.d.ts} +0 -0
  68. /package/dist/components/{ImageBackground.d.ts → ImageBackground/index.d.ts} +0 -0
  69. /package/dist/components/{ImageBackground.js → ImageBackground/index.js} +0 -0
  70. /package/dist/components/{IndicatorLight.d.ts → IndicatorLight/index.d.ts} +0 -0
  71. /package/dist/components/{IndicatorLight.js → IndicatorLight/index.js} +0 -0
  72. /package/dist/components/{LineChartEditor.d.ts → LineChartEditor/index.d.ts} +0 -0
  73. /package/dist/components/{LineChartTable.d.ts → LineChartTable/index.d.ts} +0 -0
  74. /package/dist/components/{QuickDateRangePicker.d.ts → QuickDateRangePicker/index.d.ts} +0 -0
  75. /package/dist/components/{SegmentedButtons.d.ts → SegmentedButtons/index.d.ts} +0 -0
  76. /package/dist/components/{Sidebar.d.ts → Sidebar/index.d.ts} +0 -0
  77. /package/dist/components/{TsingrocDatePicker.d.ts → TsingrocDatePicker/index.d.ts} +0 -0
  78. /package/dist/components/{TsingrocTheme.d.ts → TsingrocTheme/index.d.ts} +0 -0
  79. /package/dist/components/{TsingrocTheme.js → TsingrocTheme/index.js} +0 -0
  80. /package/dist/components/{UserButton.d.ts → UserButton/index.d.ts} +0 -0
@@ -1,9 +1,18 @@
1
1
  import { type JwtPayload } from "jwt-decode";
2
- import type { AuthService, UserInfo } from "./AuthService";
3
- import { fetcherWithBearerToken } from "./Fetcher";
2
+ import type { AuthService, UserInfo } from "../AuthService";
3
+ import { fetcherWithBearerToken } from "../Fetcher";
4
4
  export interface LocalAuthServiceOptions {
5
+ /** 打开登录页面的实现。这里可以通过直接给 `window.location` 赋值实现,但更好的方式是使用项目中使用的 router 库跳转。 */
5
6
  openLoginPage: () => void;
7
+ /**
8
+ * 登录接口的 origin。
9
+ * @default location.origin
10
+ */
6
11
  signinOrigin?: string;
12
+ /**
13
+ * 登录接口的路径。
14
+ * @default "/api/signin"
15
+ */
7
16
  signinPath?: string;
8
17
  }
9
18
  /**
@@ -87,4 +96,4 @@ export interface LocalUserInfo {
87
96
  * 获取 {@linkcode LocalAuthService} 的登录函数。
88
97
  * 返回的函数只负责使用账号密码登录并将得到的 token 存入 session store,用户需要自行实现登录完成后的跳转。
89
98
  */
90
- export declare function useLocalLogin(): (username: string, password: string) => Promise<import("./SessionStore").Session>;
99
+ export declare function useLocalLogin(): (username: string, password: string) => Promise<import("../SessionStore").Session>;
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { jwtDecode } from "jwt-decode";
3
- import { useSessionStoreInternal } from "./AuthProvider"; // oxlint-disable-line no-unused-vars
3
+ import { useSessionStoreInternal } from "../AuthProvider"; // oxlint-disable-line no-unused-vars
4
4
 
5
- import { fetcherWithBearerToken } from "./Fetcher";
5
+ import { fetcherWithBearerToken } from "../Fetcher";
6
6
  // oxlint-disable-line no-unused-vars
7
7
 
8
8
  /**
@@ -1,17 +1,33 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { Session } from "./SessionStore";
3
3
  export interface LoginCheckProps {
4
+ /** 会话首次验证成功时触发的事件。 */
4
5
  onValidated?: (session: Session) => void;
6
+ /** 会话重新验证成功时触发的事件。 */
5
7
  onRevalidated?: (session: Session) => void;
8
+ /** 会话创建失败时触发的事件。 */
6
9
  onFailed?: (err: unknown) => void;
10
+ /** 会话验证失败或者被手动终止时触发的事件。 */
7
11
  onInvalidated?: (err: unknown) => void;
12
+ /**
13
+ * 尝试登录之前进行的操作。通常在这个回调中保存登录的返回地址,
14
+ * 之后在 `CasdoorCallback` 中或者调用 `useLocalLogin` 之后读取返回地址并跳转。
15
+ */
8
16
  onBeforeGetSession?: () => void;
17
+ /** 正在登录时显示的内容。 */
9
18
  loading?: ReactNode;
19
+ /** 登录失败时显示的内容。 */
10
20
  failed?: ReactNode;
21
+ /** 已登录时正常显示的内容。 */
11
22
  children: ReactNode;
12
23
  }
13
24
  /**
14
25
  * 限制只有已登录用户才能访问内部的组件。
15
26
  * 未登录用户在该组件渲染时会自动尝试登录,登录方式由当前上下文使用的鉴权服务实现决定。
27
+ *
28
+ * 你应该把这个组件包裹在所有需要登录才能访问的页面之外(通常就是除了登录页面和 Casdoor Callback 页面以外的所有页面)。
29
+ *
30
+ * **注意**:该组件不会自动记录登录的返回地址。由于各个项目使用的 router 不同、鉴权机制不同,
31
+ * 各个项目应该自行实现返回地址的保存和恢复。例如,嵌入式鉴权在登录时不发生跳转,因此不需要记录返回地址。
16
32
  */
17
33
  export declare function LoginCheck(props: LoginCheckProps): ReactNode;
@@ -3,6 +3,11 @@ import { useSessionStoreInternal } from "./AuthProvider";
3
3
  /**
4
4
  * 限制只有已登录用户才能访问内部的组件。
5
5
  * 未登录用户在该组件渲染时会自动尝试登录,登录方式由当前上下文使用的鉴权服务实现决定。
6
+ *
7
+ * 你应该把这个组件包裹在所有需要登录才能访问的页面之外(通常就是除了登录页面和 Casdoor Callback 页面以外的所有页面)。
8
+ *
9
+ * **注意**:该组件不会自动记录登录的返回地址。由于各个项目使用的 router 不同、鉴权机制不同,
10
+ * 各个项目应该自行实现返回地址的保存和恢复。例如,嵌入式鉴权在登录时不发生跳转,因此不需要记录返回地址。
6
11
  */
7
12
  export function LoginCheck(props) {
8
13
  const {
@@ -6,13 +6,25 @@ export interface SessionStoreOptions {
6
6
  * @default true
7
7
  */
8
8
  persistent?: boolean;
9
- /** 将状态保存到 localStorage 时使用的 key。 @default "access_token" */
9
+ /**
10
+ * 将状态保存到 localStorage 时使用的 key。
11
+ * @default "access_token"
12
+ */
10
13
  persistentKey?: string;
11
- /** 自动检查登录状态是否有效的间隔时间(单位毫秒),若为 0 则不再定期检查。 @default 0 */
14
+ /**
15
+ * 自动检查登录状态是否有效的间隔时间(单位毫秒),若为 0 则不再定期检查。
16
+ * @default 0
17
+ */
12
18
  revalidateInterval?: number;
13
- /** 是否在窗口/标签页获得焦点时立即检查登录状态是否有效。 @default false */
19
+ /**
20
+ * 是否在窗口/标签页获得焦点时立即检查登录状态是否有效。
21
+ * @default false
22
+ */
14
23
  revalidateOnFocus?: boolean;
15
- /** 是否在网络连接恢复时立即检查登录状态是否有效。 @default false */
24
+ /**
25
+ * 是否在网络连接恢复时立即检查登录状态是否有效。
26
+ * @default false
27
+ */
16
28
  revalidateOnReconnect?: boolean;
17
29
  }
18
30
  /** 负责储存登录会话状态,并提供会话状态持久化、自动检查会话有效性等功能。 */
@@ -173,7 +173,7 @@ export class SessionStore {
173
173
  listener(event);
174
174
  }
175
175
  }
176
- #revalidateTask = undefined;
176
+ #revalidateTask;
177
177
  #updateRevalidateTask() {
178
178
  if (this.#revalidateInterval && this.#session) {
179
179
  this.#revalidateTask = setTimeout(async () => {
@@ -0,0 +1,37 @@
1
+ import type { CasdoorAuthServiceOptions } from "./CasdoorAuth";
2
+ import type { EmbeddedAuthServiceOptions } from "./EmbeddedAuth";
3
+ import type { LocalAuthServiceOptions } from "./LocalAuth";
4
+ /**
5
+ * 基于 Casdoor 的鉴权服务。该鉴权服务的登录流程如下:
6
+ *
7
+ * 1. 调用 {@linkcode CasdoorAuthService.getSession | getSession()} 跳转到 SSO 登录页面。
8
+ * 2. 用户在登录页面完成登录,跳转到回调页面。
9
+ * 3. 回调页面调用 {@linkcode CasdoorAuthService.callback | callback()} 获取 token。
10
+ *
11
+ * 当使用 {@linkcode AuthProvider} 时,第 1 步由 {@linkcode LoginCheck} 完成,
12
+ * 第 3 步由 {@linkcode CasdoorCallback} 完成。
13
+ */
14
+ export declare const CasdoorAuthService: (_props: CasdoorAuthServiceOptions) => import("react/jsx-runtime").JSX.Element;
15
+ /**
16
+ * 嵌入式鉴权服务,只能在 iframe 内使用。该鉴权服务的登录流程如下:
17
+ *
18
+ * 1. 调用 {@linkcode EmbeddedAuthService.getSession | getSession()} 向父页面获取 token。
19
+ * 2. 父页面响应请求,提供 token。
20
+ * 3. {@linkcode EmbeddedAuthService.getSession | getSession()} 返回 token。
21
+ *
22
+ * 当使用 {@linkcode AuthProvider} 时,第 1、3 步由 {@linkcode LoginCheck} 完成,
23
+ * 第 2 步由父页面中的 {@linkcode Embed} 完成。
24
+ */
25
+ export declare const EmbeddedAuthService: (_props: EmbeddedAuthServiceOptions) => import("react/jsx-runtime").JSX.Element;
26
+ /**
27
+ * 用于内网使用的鉴权服务,目前只有风功率预测系统在使用这个鉴权服务。该鉴权服务的登录流程如下:
28
+ *
29
+ * 1. 调用 {@linkcode LocalAuthService.getSession | getSession()} 跳转到登录页面。
30
+ * 这个操作的具体实现由初始化时的设置项 {@linkcode LocalAuthServiceOptions.openLoginPage | openLoginPage} 提供。
31
+ * 用户需要自行实现跳转操作,可以直接修改 {@linkcode window.location},也可以使用 router 提供的导航功能。
32
+ * 2. 用户在登录页面输入账号密码,调用 {@linkcode LocalAuthService.login | login()} 得到 token。
33
+ *
34
+ * 当使用 {@linkcode AuthProvider} 时,第 1 步会由 {@linkcode LoginCheck} 自动调用,
35
+ * 第 2 步可以通过 {@linkcode useLocalLogin} 获取到登录函数。
36
+ */
37
+ export declare const LocalAuthService: (_props: LocalAuthServiceOptions) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,68 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * 基于 Casdoor 的鉴权服务。该鉴权服务的登录流程如下:
5
+ *
6
+ * 1. 调用 {@linkcode CasdoorAuthService.getSession | getSession()} 跳转到 SSO 登录页面。
7
+ * 2. 用户在登录页面完成登录,跳转到回调页面。
8
+ * 3. 回调页面调用 {@linkcode CasdoorAuthService.callback | callback()} 获取 token。
9
+ *
10
+ * 当使用 {@linkcode AuthProvider} 时,第 1 步由 {@linkcode LoginCheck} 完成,
11
+ * 第 3 步由 {@linkcode CasdoorCallback} 完成。
12
+ */
13
+ export const CasdoorAuthService = _props => {
14
+ const $ = _c(1);
15
+ let t0;
16
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
17
+ t0 = /*#__PURE__*/_jsx("a", {});
18
+ $[0] = t0;
19
+ } else {
20
+ t0 = $[0];
21
+ }
22
+ return t0;
23
+ };
24
+
25
+ /**
26
+ * 嵌入式鉴权服务,只能在 iframe 内使用。该鉴权服务的登录流程如下:
27
+ *
28
+ * 1. 调用 {@linkcode EmbeddedAuthService.getSession | getSession()} 向父页面获取 token。
29
+ * 2. 父页面响应请求,提供 token。
30
+ * 3. {@linkcode EmbeddedAuthService.getSession | getSession()} 返回 token。
31
+ *
32
+ * 当使用 {@linkcode AuthProvider} 时,第 1、3 步由 {@linkcode LoginCheck} 完成,
33
+ * 第 2 步由父页面中的 {@linkcode Embed} 完成。
34
+ */
35
+ export const EmbeddedAuthService = _props => {
36
+ const $ = _c(1);
37
+ let t0;
38
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
39
+ t0 = /*#__PURE__*/_jsx("a", {});
40
+ $[0] = t0;
41
+ } else {
42
+ t0 = $[0];
43
+ }
44
+ return t0;
45
+ };
46
+
47
+ /**
48
+ * 用于内网使用的鉴权服务,目前只有风功率预测系统在使用这个鉴权服务。该鉴权服务的登录流程如下:
49
+ *
50
+ * 1. 调用 {@linkcode LocalAuthService.getSession | getSession()} 跳转到登录页面。
51
+ * 这个操作的具体实现由初始化时的设置项 {@linkcode LocalAuthServiceOptions.openLoginPage | openLoginPage} 提供。
52
+ * 用户需要自行实现跳转操作,可以直接修改 {@linkcode window.location},也可以使用 router 提供的导航功能。
53
+ * 2. 用户在登录页面输入账号密码,调用 {@linkcode LocalAuthService.login | login()} 得到 token。
54
+ *
55
+ * 当使用 {@linkcode AuthProvider} 时,第 1 步会由 {@linkcode LoginCheck} 自动调用,
56
+ * 第 2 步可以通过 {@linkcode useLocalLogin} 获取到登录函数。
57
+ */
58
+ export const LocalAuthService = _props => {
59
+ const $ = _c(1);
60
+ let t0;
61
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t0 = /*#__PURE__*/_jsx("a", {});
63
+ $[0] = t0;
64
+ } else {
65
+ t0 = $[0];
66
+ }
67
+ return t0;
68
+ };
@@ -0,0 +1,34 @@
1
+ import type { FlowGLSeriesOption } from "./gl";
2
+ import type { LegendOption } from "./legend";
3
+ import type { RadarOption } from "./radar";
4
+ /** 添加一张雷达图。*/
5
+ export declare const Radar: (_props: RadarOption) => import("react/jsx-runtime").JSX.Element;
6
+ /**
7
+ * 添加一个图例。
8
+ */
9
+ export declare const Legend: (_props: LegendOption) => import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * 添加悬停提示。这只是对官方 tooltip 组件的简单包装,设置参见 [ECharts 文档][1]。
12
+ *
13
+ * **注意**:ECharts 尚不支持多个 tooltip,在含有多个图表的
14
+ * ECharts 实例中 tooltip 的 `trigger` 值必须支持所有图表。
15
+ * 因此,若需要对每个图表使用不同的 tooltip 设置,请将其拆分成多个
16
+ * ECharts 实例。
17
+ *
18
+ * [1]: https://echarts.apache.org/zh/option.html#tooltip
19
+ */
20
+ export declare const Tooltip: () => import("react/jsx-runtime").JSX.Element;
21
+ /**
22
+ * 在坐标系上绘制一个流场。
23
+ *
24
+ * 推荐使用以下坐标系配置:
25
+ *
26
+ * ```ts
27
+ * echarts.useGrid({
28
+ * xAxis: { type: "value" },
29
+ * yAxis: { min: "dataMin", max: "dataMax" },
30
+ * presets: [echarts.minimalGrid()],
31
+ * })
32
+ * ```
33
+ */
34
+ export declare const FlowGLSeries: (_props: FlowGLSeriesOption) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /** 添加一张雷达图。*/
4
+ export const Radar = _props => {
5
+ const $ = _c(1);
6
+ let t0;
7
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
8
+ t0 = /*#__PURE__*/_jsx("a", {});
9
+ $[0] = t0;
10
+ } else {
11
+ t0 = $[0];
12
+ }
13
+ return t0;
14
+ };
15
+
16
+ /**
17
+ * 添加一个图例。
18
+ */
19
+ export const Legend = _props => {
20
+ const $ = _c(1);
21
+ let t0;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t0 = /*#__PURE__*/_jsx("a", {});
24
+ $[0] = t0;
25
+ } else {
26
+ t0 = $[0];
27
+ }
28
+ return t0;
29
+ };
30
+
31
+ /**
32
+ * 添加悬停提示。这只是对官方 tooltip 组件的简单包装,设置参见 [ECharts 文档][1]。
33
+ *
34
+ * **注意**:ECharts 尚不支持多个 tooltip,在含有多个图表的
35
+ * ECharts 实例中 tooltip 的 `trigger` 值必须支持所有图表。
36
+ * 因此,若需要对每个图表使用不同的 tooltip 设置,请将其拆分成多个
37
+ * ECharts 实例。
38
+ *
39
+ * [1]: https://echarts.apache.org/zh/option.html#tooltip
40
+ */
41
+ export const Tooltip = () => {
42
+ const $ = _c(1);
43
+ let t0;
44
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
45
+ t0 = /*#__PURE__*/_jsx("a", {});
46
+ $[0] = t0;
47
+ } else {
48
+ t0 = $[0];
49
+ }
50
+ return t0;
51
+ };
52
+
53
+ /**
54
+ * 在坐标系上绘制一个流场。
55
+ *
56
+ * 推荐使用以下坐标系配置:
57
+ *
58
+ * ```ts
59
+ * echarts.useGrid({
60
+ * xAxis: { type: "value" },
61
+ * yAxis: { min: "dataMin", max: "dataMax" },
62
+ * presets: [echarts.minimalGrid()],
63
+ * })
64
+ * ```
65
+ */
66
+ export const FlowGLSeries = _props => {
67
+ const $ = _c(1);
68
+ let t0;
69
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
70
+ t0 = /*#__PURE__*/_jsx("a", {});
71
+ $[0] = t0;
72
+ } else {
73
+ t0 = $[0];
74
+ }
75
+ return t0;
76
+ };
@@ -0,0 +1,10 @@
1
+ import type { GridOption } from "./grid";
2
+ import type { PolarOption } from "./polar";
3
+ /**
4
+ * 添加一个直角坐标系。X 轴和 Y 轴的数据类型默认值与 ECharts 原版一致。
5
+ */
6
+ export declare const Grid: (_props: GridOption) => import("react/jsx-runtime").JSX.Element;
7
+ /**
8
+ * 添加一个极坐标系。角度轴和半径轴的数据类型默认值与 ECharts 原版一致。
9
+ */
10
+ export declare const Polar: (_props: PolarOption) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * 添加一个直角坐标系。X 轴和 Y 轴的数据类型默认值与 ECharts 原版一致。
5
+ */
6
+ export const Grid = _props => {
7
+ const $ = _c(1);
8
+ let t0;
9
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
+ t0 = /*#__PURE__*/_jsx("a", {});
11
+ $[0] = t0;
12
+ } else {
13
+ t0 = $[0];
14
+ }
15
+ return t0;
16
+ };
17
+
18
+ /**
19
+ * 添加一个极坐标系。角度轴和半径轴的数据类型默认值与 ECharts 原版一致。
20
+ */
21
+ export const Polar = _props => {
22
+ const $ = _c(1);
23
+ let t0;
24
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25
+ t0 = /*#__PURE__*/_jsx("a", {});
26
+ $[0] = t0;
27
+ } else {
28
+ t0 = $[0];
29
+ }
30
+ return t0;
31
+ };
@@ -36,11 +36,10 @@ export function flowGLSeries(option) {
36
36
  /** 将 JSON 格式的天气数据预处理成 FlowGL 接受的格式。*/
37
37
  export function preprocessWindData(data) {
38
38
  return data.map(item => {
39
- const [x, y] = item.location.split(" ").map(Number.parseFloat);
40
- // prettier-ignore
39
+ const [x, y] =
40
+ //
41
+ item.location.split(" ").map(Number.parseFloat);
41
42
  const sx = -Math.cos(item.wind_direction_80m * (Math.PI / 180)) * item.wind_speed_80m;
42
- // prettier-ignore
43
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion
44
43
  const sy = +Math.sin(item.wind_direction_80m * (Math.PI / 180)) * item.wind_speed_80m;
45
44
  return [x, y, sx, sy];
46
45
  });
@@ -22,7 +22,7 @@ export function buildEChartsOption(base, ...components) {
22
22
  for (const component of components) {
23
23
  Object.entries(component).forEach(([k, value]) => {
24
24
  const key = k;
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
25
+ // oxlint-disable-next-line no-unsafe-argument
26
26
  (option[key] ??= []).push(...(value ?? []));
27
27
  });
28
28
  }
@@ -0,0 +1,31 @@
1
+ import type { BarSeriesOption } from "./barSeries";
2
+ import type { BoxplotSeriesOption } from "./boxplotSeries";
3
+ import type { IntervalSeriesOption } from "./intervalSeries";
4
+ import type { LineSeriesOption } from "./lineSeries";
5
+ import type { MaxBarSeriesOption } from "./maxBarSeries";
6
+ import type { PieSeriesOption } from "./pieSeries";
7
+ import type { WindLineSeriesOption } from "./windLineSeries";
8
+ /**
9
+ * 在坐标系上添加一组条形图。
10
+ */
11
+ export declare const BarSeries: (_props: BarSeriesOption) => import("react/jsx-runtime").JSX.Element;
12
+ /** 在坐标系上添加一组箱线图。*/
13
+ export declare const BoxplotSeries: (_props: BoxplotSeriesOption) => import("react/jsx-runtime").JSX.Element;
14
+ /** 绘制一个从下边界到上边界的带状区间。*/
15
+ export declare const IntervalSeries: (_props: IntervalSeriesOption) => import("react/jsx-runtime").JSX.Element;
16
+ /**
17
+ * 在坐标系上添加一条折线。
18
+ */
19
+ export declare const LineSeries: (_props: LineSeriesOption) => import("react/jsx-runtime").JSX.Element;
20
+ /** 求出多个系列的最大值,显示为条形图。*/
21
+ export declare const MaxBarSeries: (_props: MaxBarSeriesOption) => import("react/jsx-runtime").JSX.Element;
22
+ /**
23
+ * 添加一个饼图。
24
+ *
25
+ * 请使用 ECharts 的 legend 组件来添加图例,不要手动编写 React 代码制作图例。
26
+ */
27
+ export declare const PieSeries: (_props: PieSeriesOption) => import("react/jsx-runtime").JSX.Element;
28
+ /**
29
+ * 风速风向折线图。
30
+ */
31
+ export declare const WindLineSeries: (_props: WindLineSeriesOption) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,102 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * 在坐标系上添加一组条形图。
5
+ */
6
+ export const BarSeries = _props => {
7
+ const $ = _c(1);
8
+ let t0;
9
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
+ t0 = /*#__PURE__*/_jsx("a", {});
11
+ $[0] = t0;
12
+ } else {
13
+ t0 = $[0];
14
+ }
15
+ return t0;
16
+ };
17
+
18
+ /** 在坐标系上添加一组箱线图。*/
19
+ export const BoxplotSeries = _props => {
20
+ const $ = _c(1);
21
+ let t0;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t0 = /*#__PURE__*/_jsx("a", {});
24
+ $[0] = t0;
25
+ } else {
26
+ t0 = $[0];
27
+ }
28
+ return t0;
29
+ };
30
+
31
+ /** 绘制一个从下边界到上边界的带状区间。*/
32
+ export const IntervalSeries = _props => {
33
+ const $ = _c(1);
34
+ let t0;
35
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
36
+ t0 = /*#__PURE__*/_jsx("a", {});
37
+ $[0] = t0;
38
+ } else {
39
+ t0 = $[0];
40
+ }
41
+ return t0;
42
+ };
43
+
44
+ /**
45
+ * 在坐标系上添加一条折线。
46
+ */
47
+ export const LineSeries = _props => {
48
+ const $ = _c(1);
49
+ let t0;
50
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
51
+ t0 = /*#__PURE__*/_jsx("a", {});
52
+ $[0] = t0;
53
+ } else {
54
+ t0 = $[0];
55
+ }
56
+ return t0;
57
+ };
58
+
59
+ /** 求出多个系列的最大值,显示为条形图。*/
60
+ export const MaxBarSeries = _props => {
61
+ const $ = _c(1);
62
+ let t0;
63
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
64
+ t0 = /*#__PURE__*/_jsx("a", {});
65
+ $[0] = t0;
66
+ } else {
67
+ t0 = $[0];
68
+ }
69
+ return t0;
70
+ };
71
+
72
+ /**
73
+ * 添加一个饼图。
74
+ *
75
+ * 请使用 ECharts 的 legend 组件来添加图例,不要手动编写 React 代码制作图例。
76
+ */
77
+ export const PieSeries = _props => {
78
+ const $ = _c(1);
79
+ let t0;
80
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
81
+ t0 = /*#__PURE__*/_jsx("a", {});
82
+ $[0] = t0;
83
+ } else {
84
+ t0 = $[0];
85
+ }
86
+ return t0;
87
+ };
88
+
89
+ /**
90
+ * 风速风向折线图。
91
+ */
92
+ export const WindLineSeries = _props => {
93
+ const $ = _c(1);
94
+ let t0;
95
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t0 = /*#__PURE__*/_jsx("a", {});
97
+ $[0] = t0;
98
+ } else {
99
+ t0 = $[0];
100
+ }
101
+ return t0;
102
+ };
@@ -12,10 +12,8 @@ export function boxplotSeries(option) {
12
12
  ...option.option,
13
13
  tooltip: {
14
14
  formatter: param => {
15
- // prettier-ignore
16
15
  const data = param.data;
17
16
  const strong = body => `<strong style="text-align: right;">${body}</strong>`;
18
- // TODO i18n
19
17
  return `
20
18
  ${param.name}<br>
21
19
  <div style="
@@ -15,7 +15,6 @@ const INTERVAL_SERIES_DEFAULTS = {
15
15
  /** 绘制一个从下边界到上边界的带状区间。*/
16
16
  export function intervalSeries(option) {
17
17
  echarts.use(LineChart);
18
- // TODO i18n
19
18
  const min = {
20
19
  id: option.name + "下边界",
21
20
  name: option.name + "下边界",
@@ -10,7 +10,6 @@ export function maxBarSeries(option) {
10
10
  data: Array.from({
11
11
  length: option.data[0].length
12
12
  }, (_, i) => {
13
- // prettier-ignore
14
13
  const [max, maxJ] = option.data.map(series => series[i]).reduce(([max, maxJ], y, j) => max === undefined || y !== undefined && y > max ? [y, j] : [max, maxJ], [undefined, -1]);
15
14
  if (max !== undefined && option.palette) {
16
15
  return {
package/dist/index.d.ts CHANGED
@@ -25,4 +25,3 @@ export { default as Sidebar, type SidebarProps } from "./components/Sidebar";
25
25
  export { default as TsingrocDatePicker, type DatePickerProps, } from "./components/TsingrocDatePicker";
26
26
  export { default as TsingrocTheme, type TsingrocThemeProps, } from "./components/TsingrocTheme";
27
27
  export { default as UserButton, type UserButtonProps, } from "./components/UserButton";
28
- export { default as WeatherMap, type WeatherMapProps, type WeatherData, } from "./components/WeatherMap";
package/dist/index.js CHANGED
@@ -23,5 +23,4 @@ export { withSelectable } from "./components/SelectableECharts";
23
23
  export { default as Sidebar } from "./components/Sidebar";
24
24
  export { default as TsingrocDatePicker } from "./components/TsingrocDatePicker";
25
25
  export { default as TsingrocTheme } from "./components/TsingrocTheme";
26
- export { default as UserButton } from "./components/UserButton";
27
- export { default as WeatherMap } from "./components/WeatherMap";
26
+ export { default as UserButton } from "./components/UserButton";
@@ -1,7 +1,6 @@
1
1
  export function destructureLineDataItem(value, i) {
2
2
  if (value == null) return value;
3
- let rawValue,
4
- option = undefined;
3
+ let rawValue, option;
5
4
  if (typeof value === "object" && !(value instanceof Date) && !Array.isArray(value)) {
6
5
  ({
7
6
  value: rawValue,