diff --git a/.vscode/settings.json b/.vscode/settings.json
index 5b819f261..1e482b2db 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,7 +1,4 @@
{
- "cSpell.words": [
- "bbox",
- "Sparkline",
- "timebar"
- ]
-}
\ No newline at end of file
+ "cSpell.words": ["bbox", "Sparkline", "timebar"],
+ "svg.preview.background": "white"
+}
diff --git a/__tests__/integration/components/axis/axis-animation-update-12.ts b/__tests__/integration/components/axis/axis-animation-update-12.ts
index bdcd304e5..6c34e8e3a 100644
--- a/__tests__/integration/components/axis/axis-animation-update-12.ts
+++ b/__tests__/integration/components/axis/axis-animation-update-12.ts
@@ -14,8 +14,7 @@ export const AxisAnimationUpdate12 = () => {
const g1 = group.appendChild(
new Group({
style: {
- x: 100,
- y: 100,
+ transform: 'translate(100, 100)',
},
})
);
@@ -23,8 +22,7 @@ export const AxisAnimationUpdate12 = () => {
const g2 = group.appendChild(
new Group({
style: {
- x: 50,
- y: 50,
+ transform: 'translate(50, 50)',
},
})
);
diff --git a/__tests__/integration/components/axis/axis-animation-update-13.ts b/__tests__/integration/components/axis/axis-animation-update-13.ts
index ab12b6bf7..a8c18028d 100644
--- a/__tests__/integration/components/axis/axis-animation-update-13.ts
+++ b/__tests__/integration/components/axis/axis-animation-update-13.ts
@@ -13,8 +13,7 @@ export const AxisAnimationUpdate13 = () => {
group.appendChild(
new Group({
style: {
- x: 100,
- y: 100,
+ transform: 'translate(100, 100)',
},
})
);
@@ -22,8 +21,7 @@ export const AxisAnimationUpdate13 = () => {
const g2 = group.appendChild(
new Group({
style: {
- x: 50,
- y: 50,
+ transform: 'translate(50, 50)',
},
})
);
@@ -57,7 +55,7 @@ export const AxisAnimationUpdate13 = () => {
titleTransformOrigin: 'center',
titleTextBaseline: 'middle',
titlePosition: 'left',
- titleTransform: 'translate(50%, 0) rotate(-90)',
+ titleTransform: 'translate(-100%, 0) rotate(-90)',
labelDirection: 'positive',
tickDirection: 'positive',
gridDirection: 'negative',
@@ -117,3 +115,4 @@ export const AxisAnimationUpdate13 = () => {
AxisAnimationUpdate13.tags = ['坐标轴', '动画', '更新', '标题'];
AxisAnimationUpdate13.wait = 500;
+AxisAnimationUpdate13.skip = true;
diff --git a/__tests__/integration/components/axis/axis-animation-update-5.ts b/__tests__/integration/components/axis/axis-animation-update-5.ts
index dc881a254..4d64ebc67 100644
--- a/__tests__/integration/components/axis/axis-animation-update-5.ts
+++ b/__tests__/integration/components/axis/axis-animation-update-5.ts
@@ -49,7 +49,6 @@ export const AxisAnimationUpdate5 = () => {
new Button({
style: {
x: 80,
- y: 0,
text: 'reset',
onClick: reset,
},
diff --git a/__tests__/integration/components/axis/axis-animation-update-9.ts b/__tests__/integration/components/axis/axis-animation-update-9.ts
index be0bbd065..f902eb5b3 100644
--- a/__tests__/integration/components/axis/axis-animation-update-9.ts
+++ b/__tests__/integration/components/axis/axis-animation-update-9.ts
@@ -80,8 +80,3 @@ export const AxisAnimationUpdate9 = () => {
AxisAnimationUpdate9.tags = ['坐标轴', '动画', '更新'];
AxisAnimationUpdate9.wait = 500;
-
-// FIXME: skip for now
-// - transform="matrix(1,0,0,1,54.239998,265.750000)"
-// + transform="matrix(1,0,0,1,54.240002,265.750000)"
-AxisAnimationUpdate9.skip = true;
diff --git a/__tests__/integration/components/axis/axis-linear-basis-5.ts b/__tests__/integration/components/axis/axis-linear-basis-5.ts
index eb8c24556..ac6ec2345 100644
--- a/__tests__/integration/components/axis/axis-linear-basis-5.ts
+++ b/__tests__/integration/components/axis/axis-linear-basis-5.ts
@@ -24,7 +24,7 @@ export const AxisLinearBasis5 = () => {
lineExtension: [10, 10],
tickLength: 10,
labelSpacing: 5,
- labelTransform: 'rotate(90)',
+ labelTransform: 'rotate(45)',
type: 'linear',
tickLineWidth: 5,
},
diff --git a/__tests__/integration/components/axis/axis-linear-custom-tick.ts b/__tests__/integration/components/axis/axis-linear-custom-tick.ts
index cce9ddb9c..f763634ed 100644
--- a/__tests__/integration/components/axis/axis-linear-custom-tick.ts
+++ b/__tests__/integration/components/axis/axis-linear-custom-tick.ts
@@ -17,9 +17,12 @@ export const AxisLinearCustomTick = () => {
data: mockData,
labelFormatter: () => '',
tickFormatter: (datum: any, index: number, data: any, [cx, cy]: any) => {
- if (index === 3) return new Rect({ style: { width: 20, height: 20, fill: 'green', anchor: '0.5 0.5' } });
+ if (index === 3)
+ return new Rect({
+ style: { x: 0, y: 0, width: 20, height: 20, fill: 'green', transform: 'translate(-10, -10)' },
+ });
return index % 5 === 0
- ? new Circle({ style: { r: index % 10 === 0 ? 10 : 5 } })
+ ? new Circle({ style: { cx: 0, cy: 0, r: index % 10 === 0 ? 10 : 5 } })
: new Line({ style: { x1: 0, x2: 0, y1: 50 * cx, y2: 10 * cy } });
},
type: 'linear',
diff --git a/__tests__/integration/components/axis/axis-linear-label.ts b/__tests__/integration/components/axis/axis-linear-label.ts
index aa363956b..a28e0f46a 100644
--- a/__tests__/integration/components/axis/axis-linear-label.ts
+++ b/__tests__/integration/components/axis/axis-linear-label.ts
@@ -39,9 +39,11 @@ export const AxisLinearLabel = () => {
const labelIcon = new Image({
style: {
src: icon,
+ x: 0,
+ y: 0,
width: 30,
height: 30,
- anchor: '0.5 0.5',
+ transform: 'translate(-15, -15)',
},
});
const labelText = new Text({
diff --git a/__tests__/integration/components/axis/axis-linear-title-position.ts b/__tests__/integration/components/axis/axis-linear-title-position.ts
index 796342e7f..7db56f32a 100644
--- a/__tests__/integration/components/axis/axis-linear-title-position.ts
+++ b/__tests__/integration/components/axis/axis-linear-title-position.ts
@@ -33,7 +33,7 @@ export const AxisLinearTitlePosition = () => {
titleText: 'left',
titlePosition: 'l',
titleSpacing: 10,
- titleTransform: 'translate(50%, 0) rotate(-90)',
+ titleTransform: 'rotate(-90)',
});
createAxis({
startPos: [50, 500],
@@ -46,8 +46,7 @@ export const AxisLinearTitlePosition = () => {
endPos: [550, 500],
titleText: 'right',
titlePosition: 'r',
- titleSpacing: 10,
- titleTransform: 'translate(-50%, 0) rotate(-90)',
+ titleTransform: 'rotate(-90)',
});
const g1 = group.appendChild(
@@ -63,15 +62,14 @@ export const AxisLinearTitlePosition = () => {
titleText: 'right',
titlePosition: 'r',
titleSpacing: 10,
- titleTransform: 'translate(-50%, 0) rotate(-90)',
+ titleTransform: 'rotate(-90)',
})
);
const g2 = group.appendChild(
new Group({
style: {
- x: 60,
- y: 60,
+ transform: 'translate(60, 60)',
},
})
);
@@ -83,7 +81,7 @@ export const AxisLinearTitlePosition = () => {
titleText: 'right',
titlePosition: 'r',
titleSpacing: 10,
- titleTransform: 'translate(-50%, 0) rotate(-90)',
+ titleTransform: 'rotate(-90)',
})
);
diff --git a/__tests__/integration/components/axis/axis-linear-title.ts b/__tests__/integration/components/axis/axis-linear-title.ts
index 4084424cf..78f33b475 100644
--- a/__tests__/integration/components/axis/axis-linear-title.ts
+++ b/__tests__/integration/components/axis/axis-linear-title.ts
@@ -78,7 +78,6 @@ export const AxisLinearTitle = () => {
src: 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*N4ZMS7gHsUIAAAAAAAAAAABkARQnAQ',
height: 30,
width: 30,
- anchor: '0 0',
},
})
);
diff --git a/__tests__/integration/components/bugs/axis-title-position.ts b/__tests__/integration/components/bugs/axis-title-position.ts
index 3d07dee5b..c447b70c0 100644
--- a/__tests__/integration/components/bugs/axis-title-position.ts
+++ b/__tests__/integration/components/bugs/axis-title-position.ts
@@ -35,14 +35,10 @@ export const BugAxisTitlePosition = () => {
titleSpacing: 10,
titleTextBaseline: 'middle',
titleTransformOrigin: 'center',
- titleAnchor: '0.5 0.5',
- titleTransform: 'translate(50%, 0) rotate(-90)',
+ titleTransform: 'rotate(-90)',
labelAlign: 'horizontal',
labelSpacing: 4,
labelDirection: 'positive',
- lineArrow: undefined,
- gridLength: 565,
- gridDirection: 'negative',
tickDirection: 'positive',
lineOpacity: 1,
},
diff --git a/__tests__/integration/components/bugs/category-give-shape-1.ts b/__tests__/integration/components/bugs/category-give-shape-1.ts
index c5687bec7..5542e908d 100644
--- a/__tests__/integration/components/bugs/category-give-shape-1.ts
+++ b/__tests__/integration/components/bugs/category-give-shape-1.ts
@@ -21,6 +21,8 @@ export const BugCategoryWithShape1 = () => {
rect.appendChild(
new Category({
style: {
+ x: 50,
+ y: 50,
width,
height,
gridCol: 10,
diff --git a/__tests__/integration/components/bugs/category-give-shape-2.ts b/__tests__/integration/components/bugs/category-give-shape-2.ts
index 58b874657..1febdeb1d 100644
--- a/__tests__/integration/components/bugs/category-give-shape-2.ts
+++ b/__tests__/integration/components/bugs/category-give-shape-2.ts
@@ -21,6 +21,8 @@ export const BugCategoryWithShape2 = () => {
rect2.appendChild(
new Category({
style: {
+ x: 50,
+ y: 50,
titleText: 'title',
titleFontSize: 20,
width,
diff --git a/__tests__/integration/components/bugs/category-marker.ts b/__tests__/integration/components/bugs/category-marker.ts
index 883201255..c25b5152b 100644
--- a/__tests__/integration/components/bugs/category-marker.ts
+++ b/__tests__/integration/components/bugs/category-marker.ts
@@ -21,7 +21,7 @@ export const BugCategoryMarker = () => {
group.appendChild(
new Category({
style: {
- itemMarker: (d: any, i: number) => () => new Path({ style: { path: circle(0, 0, 6) } }),
+ itemMarker: (d: any, i: number) => () => new Path({ style: { d: circle(0, 0, 6) } }),
itemMarkerStroke: (_: any, index: number) => data[index].color,
data,
diff --git a/__tests__/integration/components/checkbox/checkbox1.ts b/__tests__/integration/components/checkbox/checkbox1.ts
index 9e876c76a..47c8a3c6c 100644
--- a/__tests__/integration/components/checkbox/checkbox1.ts
+++ b/__tests__/integration/components/checkbox/checkbox1.ts
@@ -7,8 +7,7 @@ export function Checkbox1() {
group.appendChild(
new Checkbox({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
labelText: 'Checkbox',
},
})
@@ -17,8 +16,7 @@ export function Checkbox1() {
const ck = group.appendChild(
new Checkbox({
style: {
- x: 10,
- y: 30,
+ transform: 'translate(10, 30)',
labelText: 'Checkbox',
checked: true,
},
diff --git a/__tests__/integration/components/indicator/indicator.ts b/__tests__/integration/components/indicator/indicator.ts
index 56ab5fdf0..3c048620f 100644
--- a/__tests__/integration/components/indicator/indicator.ts
+++ b/__tests__/integration/components/indicator/indicator.ts
@@ -6,8 +6,7 @@ import { createGrid } from '../../utils/grid';
export const IndicatorDemo = () => {
const group = new Group({
style: {
- x: 30,
- y: 30,
+ transform: 'translate(30, 30)',
},
});
@@ -218,10 +217,11 @@ export const IndicatorDemo = () => {
const mi = createIndicator({ x: 250, y: 100, labelText: 0.5, position: 'bottom' });
group.addEventListener('mousemove', (e: any) => {
- console.log(e.offset, e.canvas);
const { x, y } = e.offset;
const [dx, dy] = group.getLocalPosition();
- mi.setLocalPosition(x - dx, y - dy);
+ mi.style.x = x - dx;
+ mi.style.y = y - dy;
+ mi.update();
});
return group;
diff --git a/__tests__/integration/components/legend/category-item-10.ts b/__tests__/integration/components/legend/category-item-10.ts
index 8ce00e9de..903d14764 100644
--- a/__tests__/integration/components/legend/category-item-10.ts
+++ b/__tests__/integration/components/legend/category-item-10.ts
@@ -21,7 +21,7 @@ export const CategoryItem10 = () => {
marker: () =>
new Path({
style: {
- path: shape(0, 0, 6),
+ d: shape(0, 0, 6),
},
}),
markerStroke: 'green',
diff --git a/__tests__/integration/components/legend/category-item-marker-2.ts b/__tests__/integration/components/legend/category-item-marker-2.ts
index 21db89e32..e45e9084d 100644
--- a/__tests__/integration/components/legend/category-item-marker-2.ts
+++ b/__tests__/integration/components/legend/category-item-marker-2.ts
@@ -79,11 +79,17 @@ export const CategoryItemMarker2 = () => {
gridCol: 10,
height: 40,
titleText: 'Legend Title',
+ // titleFill: '#1D2129',
+ // titleFillOpacity: 0.65,
+ // titleFontSize: 12,
+ // titleFontWeight: 'normal',
+ // titleSpacing: 4,
+ // showTitle: false,
width: 500,
itemMarker: (d: any, i: number) => () =>
new Path({
style: {
- path: paths[i],
+ d: paths[i],
},
}),
itemMarkerStroke: 'red',
diff --git a/__tests__/integration/components/legend/category-items-11.ts b/__tests__/integration/components/legend/category-items-11.ts
index 6c4a3979c..8ba806451 100644
--- a/__tests__/integration/components/legend/category-items-11.ts
+++ b/__tests__/integration/components/legend/category-items-11.ts
@@ -24,7 +24,7 @@ export const CategoryItems11 = () => {
itemValueFill: 'green',
colPadding: 5,
itemMarker: (d: any, i: number) => () =>
- new Path({ style: { path: [circle, triangle, diamond][i % 3](0, 0, 6) } }),
+ new Path({ style: { d: [circle, triangle, diamond][i % 3](0, 0, 6) } }),
itemMarkerStroke: (_: any, index: number) => colors[index % colors.length],
itemMarkerStrokeWidth: 2,
},
diff --git a/__tests__/integration/components/legend/category-items-12.ts b/__tests__/integration/components/legend/category-items-12.ts
index 9ccfdcd13..d62be3522 100644
--- a/__tests__/integration/components/legend/category-items-12.ts
+++ b/__tests__/integration/components/legend/category-items-12.ts
@@ -22,7 +22,7 @@ export const CategoryItems12 = () => {
new CategoryItems({
style: {
data,
- itemMarker: (d: any, i: number) => () => new Path({ style: { path: circle(0, 0, 6) } }),
+ itemMarker: (d: any, i: number) => () => new Path({ style: { d: circle(0, 0, 6) } }),
itemMarkerStroke: (_: any, index: number) => data[index].color,
width: 565,
diff --git a/__tests__/integration/components/legend/category-items-9.ts b/__tests__/integration/components/legend/category-items-9.ts
index 182788158..e1f1e5e63 100644
--- a/__tests__/integration/components/legend/category-items-9.ts
+++ b/__tests__/integration/components/legend/category-items-9.ts
@@ -10,7 +10,7 @@ export const CategoryItems9 = () => {
group.appendChild(
new CategoryItems({
style: {
- data: flowItemData,
+ data: flowItemData.slice(0, 5),
layout: 'flex',
itemLabelFill: 'red',
itemValueFill: 'green',
diff --git a/__tests__/integration/components/legend/category-layout-3.ts b/__tests__/integration/components/legend/category-layout-3.ts
index ee72259cc..5a46cc45d 100644
--- a/__tests__/integration/components/legend/category-layout-3.ts
+++ b/__tests__/integration/components/legend/category-layout-3.ts
@@ -29,7 +29,7 @@ export const CategoryLayout3 = () => {
itemMarker: () => () =>
new Path({
style: {
- path: smooth(0, 0, 6),
+ d: smooth(0, 0, 6),
},
}),
},
diff --git a/__tests__/integration/components/legend/category-layout-7.ts b/__tests__/integration/components/legend/category-layout-7.ts
index 534217d47..bf2120536 100644
--- a/__tests__/integration/components/legend/category-layout-7.ts
+++ b/__tests__/integration/components/legend/category-layout-7.ts
@@ -27,7 +27,7 @@ export const CategoryLayout7 = () => {
itemMarker: () => () =>
new Path({
style: {
- path: smooth(0, 0, 6),
+ d: smooth(0, 0, 6),
},
}),
itemValueText: '',
diff --git a/__tests__/integration/components/legend/category-position-2.ts b/__tests__/integration/components/legend/category-position-2.ts
index 9a49a765d..700ec4384 100644
--- a/__tests__/integration/components/legend/category-position-2.ts
+++ b/__tests__/integration/components/legend/category-position-2.ts
@@ -8,8 +8,7 @@ export const CategoryPosition2 = () => {
const g = group.appendChild(
new Group({
style: {
- x: 50,
- y: 50,
+ transform: 'translate(50, 50)',
},
})
);
diff --git a/__tests__/integration/components/legend/continuous-1.ts b/__tests__/integration/components/legend/continuous-1.ts
index 30701e250..971a6c461 100644
--- a/__tests__/integration/components/legend/continuous-1.ts
+++ b/__tests__/integration/components/legend/continuous-1.ts
@@ -43,8 +43,7 @@ export const Continuous1 = () => {
handleMarkerSize: 30,
ribbonTrackFill: 'pink',
showLabel: false,
- x: 0,
- y,
+ transform: `translateY(${y})`,
...con,
},
})
diff --git a/__tests__/integration/components/legend/continuous-2.ts b/__tests__/integration/components/legend/continuous-2.ts
index 591cbd787..895eb8016 100644
--- a/__tests__/integration/components/legend/continuous-2.ts
+++ b/__tests__/integration/components/legend/continuous-2.ts
@@ -39,8 +39,7 @@ export const Continuous2 = () => {
ribbonTrackFill: 'pink',
showLabel: false,
type: 'size',
- x: 0,
- y,
+ transform: `translateY(${y})`,
...con,
},
})
diff --git a/__tests__/integration/components/legend/continuous-3.ts b/__tests__/integration/components/legend/continuous-3.ts
index a8ac02d04..35e0beb8d 100644
--- a/__tests__/integration/components/legend/continuous-3.ts
+++ b/__tests__/integration/components/legend/continuous-3.ts
@@ -39,8 +39,7 @@ export const Continuous3 = () => {
ribbonTrackFill: 'pink',
showLabel: false,
type: 'size',
- x: 0,
- y,
+ transform: `translateY(${y})`,
...con,
},
})
diff --git a/__tests__/integration/components/legend/continuous-4.ts b/__tests__/integration/components/legend/continuous-4.ts
index 15f556b9a..1cfe9608d 100644
--- a/__tests__/integration/components/legend/continuous-4.ts
+++ b/__tests__/integration/components/legend/continuous-4.ts
@@ -52,8 +52,7 @@ export const Continuous4 = () => {
labelFontSize: 10,
labelSpacing: 10,
labelTickStroke: 'red',
- x,
- y,
+ transform: `translate(${x}, ${y})`,
...shape,
...con,
},
diff --git a/__tests__/integration/components/legend/continuous-5.ts b/__tests__/integration/components/legend/continuous-5.ts
index 0609855c2..765c232ad 100644
--- a/__tests__/integration/components/legend/continuous-5.ts
+++ b/__tests__/integration/components/legend/continuous-5.ts
@@ -55,8 +55,7 @@ export const Continuous5 = () => {
labelSpacing: 10,
orientation: 'vertical',
showLabel: true,
- x,
- y,
+ transform: `translate(${x}, ${y})`,
...shape,
...con,
},
diff --git a/__tests__/integration/components/legend/continuous-d3-color-legend.ts b/__tests__/integration/components/legend/continuous-d3-color-legend.ts
index 8bf6c9e88..968bb3196 100644
--- a/__tests__/integration/components/legend/continuous-d3-color-legend.ts
+++ b/__tests__/integration/components/legend/continuous-d3-color-legend.ts
@@ -38,8 +38,7 @@ export const ContinuousD3ColorLegend = () => {
showLabel: true,
showHandle: false,
showTick: true,
- x: 0,
- y: 60,
+ transform: `translate(0, 60)`,
width: 400,
height: 60,
block: true,
@@ -60,8 +59,7 @@ export const ContinuousD3ColorLegend = () => {
showTick: true,
showLabel: true,
showHandle: false,
- x: 0,
- y: 120,
+ transform: `translate(0, 120)`,
width: 400,
height: 60,
block: true,
@@ -82,8 +80,7 @@ export const ContinuousD3ColorLegend = () => {
showTick: true,
showHandle: false,
showLabel: true,
- x: 0,
- y: 180,
+ transform: `translate(0, 180)`,
width: 400,
height: 60,
block: true,
diff --git a/__tests__/integration/components/legend/continuous.ts b/__tests__/integration/components/legend/continuous.ts
index 99f3e814f..6e03f8e37 100644
--- a/__tests__/integration/components/legend/continuous.ts
+++ b/__tests__/integration/components/legend/continuous.ts
@@ -21,6 +21,7 @@ export const ContinuousDemo = () => {
handleFormatter: (str: any) => `${str}°C`,
titleText: 'Title',
handleMarkerSize: 30,
+ transform: `translate(${x}, ${y})`,
...args,
},
})
diff --git a/__tests__/integration/components/legend/handle.ts b/__tests__/integration/components/legend/handle.ts
index f5a414992..75ab2efcb 100644
--- a/__tests__/integration/components/legend/handle.ts
+++ b/__tests__/integration/components/legend/handle.ts
@@ -9,8 +9,7 @@ export const HandleDemo = () => {
group.appendChild(
new Handle({
style: {
- x: 100,
- y: 100,
+ transform: `translate(${args.x || 100}, ${args.y || 100})`,
orientation: 'horizontal',
labelText: 'labelText',
...args,
diff --git a/__tests__/integration/components/legend/ribbon-color.ts b/__tests__/integration/components/legend/ribbon-color.ts
index af6d2efd5..881dbb99d 100644
--- a/__tests__/integration/components/legend/ribbon-color.ts
+++ b/__tests__/integration/components/legend/ribbon-color.ts
@@ -12,7 +12,14 @@ export const RibbonColor = () => {
const createRibbon = (args: any = {}) => {
return group.appendChild(
new Ribbon({
- style: { type: 'color', orientation: 'horizontal', size: 30, length: 200, ...args },
+ style: {
+ type: 'color',
+ orientation: 'horizontal',
+ size: 30,
+ length: 200,
+ transform: `translate(${args.x}, ${args.y})`,
+ ...args,
+ },
})
);
};
diff --git a/__tests__/integration/components/legend/ribbon.ts b/__tests__/integration/components/legend/ribbon.ts
index 28657b32d..cdcab7541 100644
--- a/__tests__/integration/components/legend/ribbon.ts
+++ b/__tests__/integration/components/legend/ribbon.ts
@@ -14,8 +14,7 @@ export const RibbonDemo = () => {
return group.appendChild(
new Ribbon({
style: {
- x: 100,
- y: 100,
+ transform: `translate(${args.x || 100}, ${args.y || 100})`,
type: 'color',
orientation: 'horizontal',
size: 30,
diff --git a/__tests__/integration/components/marker/marker-1.ts b/__tests__/integration/components/marker/marker-1.ts
index be35f115b..c97c6b53c 100644
--- a/__tests__/integration/components/marker/marker-1.ts
+++ b/__tests__/integration/components/marker/marker-1.ts
@@ -7,11 +7,17 @@ export const Marker1 = () => {
const markers = Marker.getSymbols();
markers.forEach((marker, index) => {
+ const x = 20 + (index % 10) * 50;
+ const y = 150 + Math.floor(index / 10) * 50;
group.appendChild(
new Marker({
style: {
- x: 20 + (index % 10) * 50,
- y: 150 + Math.floor(index / 10) * 50,
+ x,
+ y,
+ // transform: `translate(${x}, ${y}) rotate(45deg) translate(${-x}, ${-y})`,
+ // transformOrigin: `0 0`,
+ transform: 'rotate(45deg)',
+ transformOrigin: `${x} ${y}`,
symbol: marker,
size: 16,
stroke: 'blue',
diff --git a/__tests__/integration/components/sparkline/sparkline-10.ts b/__tests__/integration/components/sparkline/sparkline-10.ts
index e44366d74..1f53fa44e 100644
--- a/__tests__/integration/components/sparkline/sparkline-10.ts
+++ b/__tests__/integration/components/sparkline/sparkline-10.ts
@@ -7,8 +7,7 @@ export const Sparkline10 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'column',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-11.ts b/__tests__/integration/components/sparkline/sparkline-11.ts
index dc235511c..433a43459 100644
--- a/__tests__/integration/components/sparkline/sparkline-11.ts
+++ b/__tests__/integration/components/sparkline/sparkline-11.ts
@@ -7,8 +7,7 @@ export const Sparkline11 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'column',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-12.ts b/__tests__/integration/components/sparkline/sparkline-12.ts
index fcd00ceb8..91819df3a 100644
--- a/__tests__/integration/components/sparkline/sparkline-12.ts
+++ b/__tests__/integration/components/sparkline/sparkline-12.ts
@@ -7,8 +7,7 @@ export const Sparkline12 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'column',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-2.ts b/__tests__/integration/components/sparkline/sparkline-2.ts
index 4ab3d563b..d2b76c2f3 100644
--- a/__tests__/integration/components/sparkline/sparkline-2.ts
+++ b/__tests__/integration/components/sparkline/sparkline-2.ts
@@ -7,8 +7,7 @@ export const Sparkline2 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-3.ts b/__tests__/integration/components/sparkline/sparkline-3.ts
index 2bdcc5f54..0f1a3c982 100644
--- a/__tests__/integration/components/sparkline/sparkline-3.ts
+++ b/__tests__/integration/components/sparkline/sparkline-3.ts
@@ -7,8 +7,7 @@ export const Sparkline3 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-4.ts b/__tests__/integration/components/sparkline/sparkline-4.ts
index 39d771e03..a93e466e7 100644
--- a/__tests__/integration/components/sparkline/sparkline-4.ts
+++ b/__tests__/integration/components/sparkline/sparkline-4.ts
@@ -7,8 +7,7 @@ export const Sparkline4 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-5.ts b/__tests__/integration/components/sparkline/sparkline-5.ts
index 27641beae..fb78f0aea 100644
--- a/__tests__/integration/components/sparkline/sparkline-5.ts
+++ b/__tests__/integration/components/sparkline/sparkline-5.ts
@@ -7,8 +7,7 @@ export const Sparkline5 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-6.ts b/__tests__/integration/components/sparkline/sparkline-6.ts
index f84fc897f..4a106b34a 100644
--- a/__tests__/integration/components/sparkline/sparkline-6.ts
+++ b/__tests__/integration/components/sparkline/sparkline-6.ts
@@ -7,8 +7,7 @@ export const Sparkline6 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-7.ts b/__tests__/integration/components/sparkline/sparkline-7.ts
index 415d6ea7f..351ef7020 100644
--- a/__tests__/integration/components/sparkline/sparkline-7.ts
+++ b/__tests__/integration/components/sparkline/sparkline-7.ts
@@ -7,8 +7,7 @@ export const Sparkline7 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'line',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-8.ts b/__tests__/integration/components/sparkline/sparkline-8.ts
index 9452eca94..67e08d090 100644
--- a/__tests__/integration/components/sparkline/sparkline-8.ts
+++ b/__tests__/integration/components/sparkline/sparkline-8.ts
@@ -7,8 +7,7 @@ export const Sparkline8 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'column',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-9.ts b/__tests__/integration/components/sparkline/sparkline-9.ts
index 462a73c56..e9d16118c 100644
--- a/__tests__/integration/components/sparkline/sparkline-9.ts
+++ b/__tests__/integration/components/sparkline/sparkline-9.ts
@@ -7,8 +7,7 @@ export const Sparkline9 = () => {
group.appendChild(
new Sparkline({
style: {
- x: 10,
- y: 10,
+ transform: 'translate(10, 10)',
type: 'column',
width: 300,
height: 50,
diff --git a/__tests__/integration/components/sparkline/sparkline-scale-column.ts b/__tests__/integration/components/sparkline/sparkline-scale-column.ts
index 5c473bf98..bb8caaf50 100644
--- a/__tests__/integration/components/sparkline/sparkline-scale-column.ts
+++ b/__tests__/integration/components/sparkline/sparkline-scale-column.ts
@@ -29,7 +29,7 @@ export const SparklineScaleColumn = it((group) => {
})
);
- const shape2 = { x: 10, y: 70, width: 300, height: 50 };
+ const shape2 = { x: 10, y: 70, transform: `translate(30, 30)`, width: 300, height: 50 };
group.appendChild(
new Rect({
diff --git a/__tests__/integration/components/sparkline/sparkline-scale-line.ts b/__tests__/integration/components/sparkline/sparkline-scale-line.ts
index 450392f0e..b4c932e8b 100644
--- a/__tests__/integration/components/sparkline/sparkline-scale-line.ts
+++ b/__tests__/integration/components/sparkline/sparkline-scale-line.ts
@@ -3,7 +3,7 @@ import { it } from '../../utils';
import { Sparkline } from '../../../../src/ui/sparkline';
export const SparklineScaleLine = it((group) => {
- const shape1 = { x: 10, y: 10, width: 300, height: 50 };
+ const shape1 = { transform: 'translate(10, 10)', width: 300, height: 50 };
group.appendChild(
new Rect({
style: {
@@ -33,7 +33,7 @@ export const SparklineScaleLine = it((group) => {
})
);
- const shape2 = { x: 10, y: 70, width: 300, height: 50 };
+ const shape2 = { transform: 'translate(10, 70)', width: 300, height: 50 };
group.appendChild(
new Rect({
diff --git a/__tests__/integration/components/switch/switch-1.ts b/__tests__/integration/components/switch/switch-1.ts
index 00f737eca..e656890cb 100644
--- a/__tests__/integration/components/switch/switch-1.ts
+++ b/__tests__/integration/components/switch/switch-1.ts
@@ -15,7 +15,7 @@ export const Switch1 = () => {
group.appendChild(
new Switch({
style: {
- y: 40,
+ transform: 'translateY(40)',
checked: true,
},
})
@@ -24,7 +24,7 @@ export const Switch1 = () => {
const sw = group.appendChild(
new Switch({
style: {
- y: 80,
+ transform: 'translateY(80)',
checked: false,
},
})
diff --git a/__tests__/integration/components/tag/tag-1.ts b/__tests__/integration/components/tag/tag-1.ts
index 89c71c1bf..ca670e998 100644
--- a/__tests__/integration/components/tag/tag-1.ts
+++ b/__tests__/integration/components/tag/tag-1.ts
@@ -7,8 +7,7 @@ export const Tag1 = () => {
group.appendChild(
new Tag({
style: {
- x: 100,
- y: 100,
+ transform: 'translate(100, 100)',
text: 'G2',
},
})
@@ -17,8 +16,7 @@ export const Tag1 = () => {
group.appendChild(
new Tag({
style: {
- x: 200,
- y: 100,
+ transform: 'translate(200, 100)',
text: 'G6',
backgroundFill: '#DBF1B7',
labelFill: 'red',
@@ -34,8 +32,7 @@ export const Tag1 = () => {
const tag = group.appendChild(
new Tag({
style: {
- x: 300,
- y: 100,
+ transform: 'translate(300, 100)',
text: 'L7',
radius: 6,
padding: [6, 24],
diff --git a/__tests__/integration/components/title/title.ts b/__tests__/integration/components/title/title.ts
index 7f3ea5aee..1c0ee2ac2 100644
--- a/__tests__/integration/components/title/title.ts
+++ b/__tests__/integration/components/title/title.ts
@@ -5,16 +5,17 @@ export const TitleDemo = () => {
const group = new Group({});
const createTitle = (argsRect = {}, argsTitle = {}) => {
+ const { x, y, ...rest } = argsRect as any;
+
const g = group.appendChild(new Group());
const content = g.appendChild(
new Rect({
style: {
- x: 0,
- y: 0,
width: 100,
height: 100,
fill: 'red',
- ...argsRect,
+ transform: `translate(${x}, ${y})`,
+ ...rest,
},
})
);
diff --git a/__tests__/integration/main.tsx b/__tests__/integration/main.tsx
index ad0429dd9..7b7697108 100644
--- a/__tests__/integration/main.tsx
+++ b/__tests__/integration/main.tsx
@@ -17,7 +17,9 @@ const { Option } = Select;
const casesName = Object.keys(cases);
const renderers = {
svg: new SVGRenderer(),
- canvas: new CanvasRenderer(),
+ canvas: new CanvasRenderer({
+ // enableDirtyRectangleRendering: false,
+ }),
webgl: new WebGLRenderer(),
} as const;
renderers.webgl.registerPlugin(new ControlPlugin());
diff --git a/__tests__/integration/snapshots/AxisAnimationDisable.svg b/__tests__/integration/snapshots/AxisAnimationDisable.svg
index 65a0b773e..5e1f779bc 100644
--- a/__tests__/integration/snapshots/AxisAnimationDisable.svg
+++ b/__tests__/integration/snapshots/AxisAnimationDisable.svg
@@ -6,160 +6,139 @@
color-interpolation-filters="sRGB"
>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-