update at 2026-01-21 21:48:08
This commit is contained in:
@@ -6,7 +6,6 @@ import { computed, type Ref, type ComputedRef } from 'vue';
|
||||
import type { Example, Sector, TextRadialPosition } from '../types';
|
||||
import {
|
||||
polarToXY,
|
||||
calculateLabelRotation,
|
||||
generateSectorData,
|
||||
} from '../utils';
|
||||
|
||||
@@ -64,8 +63,6 @@ export function useLuopan(
|
||||
rOuter,
|
||||
aStart,
|
||||
aEnd,
|
||||
layerCount,
|
||||
pieCount,
|
||||
textRadialPosition: textRadialPositionRef.value,
|
||||
});
|
||||
|
||||
@@ -75,16 +72,6 @@ export function useLuopan(
|
||||
return res;
|
||||
});
|
||||
|
||||
/**
|
||||
* 计算标签的变换属性
|
||||
* @param s 扇区数据
|
||||
* @returns SVG transform 字符串
|
||||
*/
|
||||
const getLabelTransform = (s: Sector): string => {
|
||||
const rotDeg = calculateLabelRotation(s.aMidDeg);
|
||||
return `translate(${s.cx} ${s.cy}) rotate(${rotDeg})`;
|
||||
};
|
||||
|
||||
/**
|
||||
* 极坐标转 XY(暴露给模板使用)
|
||||
*/
|
||||
@@ -95,7 +82,6 @@ export function useLuopan(
|
||||
rings,
|
||||
outerMost,
|
||||
sectors,
|
||||
getLabelTransform,
|
||||
toXY,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user