@antv/gpt-vis 0.4.2 → 0.4.4

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.
@@ -1,10 +1,6 @@
1
1
  import type { HistogramConfig } from '@ant-design/plots';
2
2
  import React from 'react';
3
3
  import type { BasePlotProps } from '../types';
4
- type HistogramDataItem = {
5
- value: number;
6
- [key: string]: string | number;
7
- };
8
- export type HistogramProps = BasePlotProps<HistogramDataItem> & Partial<HistogramConfig>;
4
+ export type HistogramProps = BasePlotProps<number> & Partial<HistogramConfig>;
9
5
  declare const Histogram: (props: HistogramProps) => React.JSX.Element;
10
6
  export default Histogram;
@@ -36,9 +36,8 @@ var import_plots = require("@ant-design/plots");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_hooks = require("../ConfigProvider/hooks");
38
38
  var defaultConfig = (props) => {
39
- const { data, binField = "value", binNumber } = props;
39
+ const { binField = (d) => d, binNumber } = props;
40
40
  return {
41
- data,
42
41
  binField,
43
42
  binNumber,
44
43
  style: { inset: 0.5 }
@@ -32,7 +32,7 @@ var useAntdDarkAlgorithm = () => {
32
32
  const currentAlgorithm = (_b = config.theme) == null ? void 0 : _b.algorithm;
33
33
  if ((0, import_lodash.isArray)(currentAlgorithm) && currentAlgorithm.includes(darkAlgorithm))
34
34
  return true;
35
- return currentAlgorithm === darkAlgorithm;
35
+ return !!darkAlgorithm && currentAlgorithm === darkAlgorithm;
36
36
  };
37
37
  // Annotate the CommonJS export names for ESM import in node:
38
38
  0 && (module.exports = {
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.2";
1
+ declare const _default: "0.4.4";
2
2
  export default _default;
@@ -22,4 +22,4 @@ __export(version_exports, {
22
22
  default: () => version_default
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- var version_default = "0.4.2";
25
+ var version_default = "0.4.4";
@@ -1,10 +1,6 @@
1
1
  import type { HistogramConfig } from '@ant-design/plots';
2
2
  import React from 'react';
3
3
  import type { BasePlotProps } from '../types';
4
- type HistogramDataItem = {
5
- value: number;
6
- [key: string]: string | number;
7
- };
8
- export type HistogramProps = BasePlotProps<HistogramDataItem> & Partial<HistogramConfig>;
4
+ export type HistogramProps = BasePlotProps<number> & Partial<HistogramConfig>;
9
5
  declare const Histogram: (props: HistogramProps) => React.JSX.Element;
10
6
  export default Histogram;
@@ -5,12 +5,12 @@ import { usePlotConfig } from "../ConfigProvider/hooks";
5
5
  // binNumber和binWidth为互斥属性,选其一即可
6
6
 
7
7
  var defaultConfig = function defaultConfig(props) {
8
- var data = props.data,
9
- _props$binField = props.binField,
10
- binField = _props$binField === void 0 ? 'value' : _props$binField,
8
+ var _props$binField = props.binField,
9
+ binField = _props$binField === void 0 ? function (d) {
10
+ return d;
11
+ } : _props$binField,
11
12
  binNumber = props.binNumber;
12
13
  return {
13
- data: data,
14
14
  binField: binField,
15
15
  binNumber: binNumber,
16
16
  style: {
@@ -10,5 +10,5 @@ export var useAntdDarkAlgorithm = function useAntdDarkAlgorithm() {
10
10
  var config = useContext(ConfigProvider.ConfigContext);
11
11
  var currentAlgorithm = (_config$theme = config.theme) === null || _config$theme === void 0 ? void 0 : _config$theme.algorithm;
12
12
  if (isArray(currentAlgorithm) && currentAlgorithm.includes(darkAlgorithm)) return true;
13
- return currentAlgorithm === darkAlgorithm;
13
+ return !!darkAlgorithm && currentAlgorithm === darkAlgorithm;
14
14
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.2";
1
+ declare const _default: "0.4.4";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '0.4.2';
1
+ export default '0.4.4';