Skip to content

Commit 1615579

Browse files
committed
chore: naming optimization
1 parent 02280e0 commit 1615579

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/plots/src/core/constants/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const TRANSFORM_OPTION_KEY = {
216216
* 1. annotations: [{type: 'text'}] -> children: [{type: 'text'}]
217217
* 2. line: {shape: 'hvh'}-> children: [{type: 'line', style: { shape: 'hvh'}}]
218218
*/
219-
const EXTEND_KEYS = [
219+
const EXTEND_PROPERTIES = [
220220
'xField',
221221
'yField',
222222
'seriesField',
@@ -238,30 +238,30 @@ const EXTEND_KEYS = [
238238
export const CONFIG_SHAPE = [
239239
{
240240
key: 'annotations',
241-
extend_keys: [],
241+
extendedProperties: [],
242242
},
243243
{
244244
key: 'line',
245245
type: 'line',
246-
extend_keys: EXTEND_KEYS,
246+
extendedProperties: EXTEND_PROPERTIES,
247247
},
248248
{
249249
key: 'connector',
250250
type: 'connector',
251-
extend_keys: [],
251+
extendedProperties: [],
252252
},
253253
{
254254
key: 'point',
255255
type: 'point',
256-
extend_keys: EXTEND_KEYS,
257-
default_cfg: {
256+
extendedProperties: EXTEND_PROPERTIES,
257+
defaultShapeConfig: {
258258
shapeField: 'circle',
259259
},
260260
},
261261
{
262262
key: 'area',
263263
type: 'area',
264-
extend_keys: EXTEND_KEYS,
264+
extendedProperties: EXTEND_PROPERTIES,
265265
},
266266
];
267267

packages/plots/src/core/utils/transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export const transformOptions = (params: Adaptor) => {
5555
if (!config[key]) return;
5656
const exist = CONFIG_SHAPE.find((item) => item.key === key);
5757
if (exist) {
58-
const { type, extend_keys, default_cfg = {} } = exist;
58+
const { type, extendedProperties, defaultShapeConfig = {} } = exist;
5959
if (type) {
6060
const { tooltip } = config[key];
6161
children.push(
6262
transformConfig(
63-
mergeWithArrayCoverage({}, pick(config, extend_keys), default_cfg, { type }, config[key], {
63+
mergeWithArrayCoverage({}, pick(config, extendedProperties), defaultShapeConfig, { type }, config[key], {
6464
tooltip: tooltip ? tooltip : false,
6565
}),
6666
),

0 commit comments

Comments
 (0)