@antv/gpt-vis 0.4.0 → 0.4.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.
@@ -35,9 +35,9 @@ module.exports = __toCommonJS(Map_exports);
35
35
  var import_larkmap = require("@antv/larkmap");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_map = require("../utils/map");
38
- var import_Component = require("./Component/");
38
+ var import_Component = require("./Component");
39
39
  var Map = (props) => {
40
- const { className, containerStyle, children } = props;
40
+ const { className, containerStyle, style, children } = props;
41
41
  const mapConfig = (0, import_react.useMemo)(() => (0, import_map.formatMapStyle)(props), [props]);
42
42
  const onSceneLoaded = async () => {
43
43
  if (props.onInitComplete) {
@@ -48,7 +48,7 @@ var Map = (props) => {
48
48
  import_larkmap.LarkMap,
49
49
  {
50
50
  className,
51
- style: { height: 300, ...containerStyle },
51
+ style: { height: 300, ...containerStyle, ...style },
52
52
  ...mapConfig,
53
53
  onSceneLoaded
54
54
  },
@@ -35,10 +35,15 @@ module.exports = __toCommonJS(VisText_exports);
35
35
  var import_antd = require("antd");
36
36
  var import_lodash = require("lodash");
37
37
  var import_react = __toESM(require("react"));
38
+ var import_styled_components = __toESM(require("styled-components"));
38
39
  var import_hooks = require("../ConfigProvider/hooks");
39
40
  var import_config = require("./config");
40
41
  var import_utils = require("./utils");
41
42
  var { Text } = import_antd.Typography;
43
+ var StyledText = (0, import_styled_components.default)(Text)`
44
+ margin-left: 1px;
45
+ margin-right: 1px;
46
+ `;
42
47
  function renderPrefixSuffix(symbol, staticsConfig, props) {
43
48
  if (!symbol)
44
49
  return null;
@@ -56,7 +61,7 @@ var VisText = (props) => {
56
61
  return (
57
62
  // TODO @羽熙 暂时简单处理 tooltip 直接显示 origin,后续可以根据 origin 类型分类处理
58
63
  /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: (0, import_lodash.toString)(origin) }, /* @__PURE__ */ import_react.default.createElement(
59
- Text,
64
+ StyledText,
60
65
  {
61
66
  className,
62
67
  style: {
@@ -37,6 +37,7 @@ export interface BasePlotProps<T> extends BaseChartProps {
37
37
  axisYTitle?: string;
38
38
  }
39
39
  export interface BaseMapProps<T> extends BaseChartProps, Map {
40
+ style?: CSSProperties;
40
41
  data: T[];
41
42
  token?: string;
42
43
  }
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.0";
1
+ declare const _default: "0.4.2";
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.0";
25
+ var version_default = "0.4.2";
@@ -5,10 +5,11 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
5
  import { LarkMap } from '@antv/larkmap';
6
6
  import React, { useMemo } from 'react';
7
7
  import { formatMapStyle } from "../utils/map";
8
- import { MapView, Marker, Polyline } from "./Component/";
8
+ import { MapView, Marker, Polyline } from "./Component";
9
9
  var Map = function Map(props) {
10
10
  var className = props.className,
11
11
  containerStyle = props.containerStyle,
12
+ style = props.style,
12
13
  children = props.children;
13
14
  var mapConfig = useMemo(function () {
14
15
  return formatMapStyle(props);
@@ -33,9 +34,9 @@ var Map = function Map(props) {
33
34
  }();
34
35
  return /*#__PURE__*/React.createElement(LarkMap, _extends({
35
36
  className: className,
36
- style: _objectSpread({
37
+ style: _objectSpread(_objectSpread({
37
38
  height: 300
38
- }, containerStyle)
39
+ }, containerStyle), style)
39
40
  }, mapConfig, {
40
41
  onSceneLoaded: onSceneLoaded
41
42
  }), /*#__PURE__*/React.createElement(MapView, props), /*#__PURE__*/React.createElement(Marker, props), /*#__PURE__*/React.createElement(Polyline, props), children);
@@ -2,10 +2,15 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { Tooltip, Typography } from 'antd';
3
3
  import { pick, toString } from 'lodash';
4
4
  import React from 'react';
5
+ import styled from 'styled-components';
5
6
  import { useComponentGlobalConfig } from "../ConfigProvider/hooks";
6
7
  import { STATICS_KEY } from "./config";
7
8
  import { getThemeColor, useAntdDarkAlgorithm } from "./utils";
8
9
  var Text = Typography.Text;
10
+ var StyledText = styled(Text).withConfig({
11
+ displayName: "StyledText",
12
+ componentId: "gpt-vis-c7ef__sc-16yhboy-0"
13
+ })(["margin-left:1px;margin-right:1px;"]);
9
14
  function renderPrefixSuffix(symbol, staticsConfig, props) {
10
15
  if (!symbol) return null;
11
16
  var Component = staticsConfig === null || staticsConfig === void 0 ? void 0 : staticsConfig[symbol];
@@ -27,7 +32,7 @@ var VisText = function VisText(props) {
27
32
  // TODO @羽熙 暂时简单处理 tooltip 直接显示 origin,后续可以根据 origin 类型分类处理
28
33
  React.createElement(Tooltip, {
29
34
  title: toString(origin)
30
- }, /*#__PURE__*/React.createElement(Text, {
35
+ }, /*#__PURE__*/React.createElement(StyledText, {
31
36
  className: className,
32
37
  style: _objectSpread(_objectSpread({
33
38
  // antd Text 组件写死了 14px,在段落定义了 font-size 的情况下,显示很突兀,这里不设置,跟随上级容器字体大小改变。
@@ -37,6 +37,7 @@ export interface BasePlotProps<T> extends BaseChartProps {
37
37
  axisYTitle?: string;
38
38
  }
39
39
  export interface BaseMapProps<T> extends BaseChartProps, Map {
40
+ style?: CSSProperties;
40
41
  data: T[];
41
42
  token?: string;
42
43
  }
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.0";
1
+ declare const _default: "0.4.2";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '0.4.0';
1
+ export default '0.4.2';