Skip to content

Commit

Permalink
Merge branch 'main' into release/0.17.12
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Jan 9, 2024
2 parents 0dc00d9 + 87dd477 commit 9c48956
Show file tree
Hide file tree
Showing 20 changed files with 610 additions and 250 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix(marker): fix problem of no render when set visible attr and add valid judgment logic. fix@Visactor/Vchart#1901",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "feat: support fit strategy for indicator",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "feat(marker): mark point support confine. fix @Visactor/VChart#1573",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix(datazoom): adaptive handler text layout. fix@Visactor/VChart#1809",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix(datazoom): set pickable false when zoomLock. fix @Visactor/VChart#1565",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix(datazoom): handler not follow mouse after resize. fix@Visactor/Vchart#1490",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix: arc outside label invisible with visible label line",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
218 changes: 137 additions & 81 deletions packages/vrender-components/__tests__/browser/examples/indicator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@visactor/vrender';
import { createLine } from '@visactor/vrender';
import { createCircle, createLine } from '@visactor/vrender';
import render from '../../util/render';
import { Indicator } from '../../../src';

Expand Down Expand Up @@ -361,6 +361,53 @@ export function run() {
]
};

const attr7 = {
size: {
width: 500,
height: 500
},
visible: true,
// limitRatio: 0.8,
limitRatio: 1,
title: {
// visible: false,
space: 10,
autoFit: true,
fitStrategy: 'inscribed',
fitPercent: 1,
style: {
fontSize: 64,
text: 'TitleABCDEFG'
}
},
content: [
{
space: 5,
// autoFit: true,
fitStrategy: 'inscribed',
fitPercent: 1,
style: {
fontSize: 66,
text: 'CONTENT0'
}
},
{
autoLimit: true,
autoFit: true,
fitPercent: 1,
fitStrategy: 'inscribed',
// space: 5,
style: {
fontSize: 16,
// text: 'CONTENT111111111111111111111111111111111111111111111111111111111111111111111111111111',
text: 'CONTENT1111111111111111111111111111111111111111111111111111',
fill: 'blue',
fontWeight: 'bolder'
}
}
]
};

const attr_progress = {
visible: true,
size: {
Expand Down Expand Up @@ -434,86 +481,89 @@ export function run() {

// const indicator = new Indicator(attr_progress);

const indicator = new Indicator({
// dx: 100,
// dy: 100,
size: {
width: 500,
height: 500
},
visible: true,
limitRatio: 0.8,
title: {
// visible: false,
space: 10,
// autoLimit: true,
autoFit: true,
style: {
type: 'rich',
text: [
{
text: 'Visactor-',
fontWeight: 'bold',
fontSize: 42,
fill: 'red'
},

{
text: 'vchart',
textDecoration: 'underline',
fontSize: 36,
fill: 'black'
}
],
fontSize: 42,

fill: 'red'
}
},
content: [
{
// fitPercent: 1,
// autoFit: true,
// visible: true,
space: 5,
// autoLimit: true,
style: {
fontSize: 16,
// text: 'CONTENT0'
type: 'rich',
text: [
{
text: 'Mapbox',
fontWeight: 'bold',
fontSize: 25,
fill: '#3f51b5'
},

{
text: '替代方案',
fontStyle: 'italic',
textDecoration: 'underline',
fill: '#3f51b5'
}
]
}
},
{
// visible: false,
// fitPercent: 0.2,
autoLimit: true,
// autoFit: true,
space: 5,
style: {
fontSize: 16,
text: 'CONTENT111111111111111111111111111111111111111111111111111111111111111111111111111111',

fill: 'blue',
fontWeight: 'bolder'
}
}
]
});
// const indicator = new Indicator({
// // dx: 100,
// // dy: 100,
// size: {
// width: 500,
// height: 500
// },
// visible: true,
// // limitRatio: 0.8,
// limitRatio: 1,
// title: {
// // visible: false,
// space: 10,
// // autoLimit: true,
// autoFit: true,
// style: {
// type: 'rich',
// text: [
// {
// text: 'Visactor-',
// fontWeight: 'bold',
// fontSize: 42,
// fill: 'red'
// },

// {
// text: 'vchart',
// textDecoration: 'underline',
// fontSize: 36,
// fill: 'black'
// }
// ],
// fontSize: 42,

// fill: 'red'
// }
// },
// content: [
// {
// // fitPercent: 1,
// // autoFit: true,
// // visible: true,
// space: 5,
// // autoLimit: true,
// style: {
// fontSize: 16,
// // text: 'CONTENT0'
// type: 'rich',
// text: [
// {
// text: 'Mapbox',
// fontWeight: 'bold',
// fontSize: 25,
// fill: '#3f51b5'
// },

// {
// text: '替代方案',
// fontStyle: 'italic',
// textDecoration: 'underline',
// fill: '#3f51b5'
// }
// ]
// }
// },
// {
// // visible: false,
// // fitPercent: 0.2,
// autoLimit: true,
// // autoFit: true,
// space: 5,
// style: {
// fontSize: 16,
// text: 'CONTENT111111111111111111111111111111111111111111111111111111111111111111111111111111',

// fill: 'blue',
// fontWeight: 'bolder'
// }
// }
// ]
// });

const indicator = new Indicator(attr7);

/** 指标卡部分隐藏 */
// const indicator = new Indicator(attr1);
Expand Down Expand Up @@ -563,6 +613,12 @@ export function run() {

stroke: '#ccc',
lineDash: [2]
}),
createCircle({
x: 250,
y: 250,
radius: 250,
fill: 'rgba(0, 0, 0, 0.1)'
})
],
'main'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export function run() {
itemRefX: 10,
itemRefY: 0,
itemRefAngle: 0,
decorativeLineVisible: false
decorativeLineVisible: false,
visible: true
};

const styleAttr = {
Expand All @@ -34,6 +35,7 @@ export function run() {
refX: guiObject.itemRefX,
refY: guiObject.itemRefY,
refAngle: guiObject.itemRefAngle,
confine: true,
textStyle: {
// text: 'mark point label text'
type: 'rich',
Expand Down Expand Up @@ -108,6 +110,7 @@ export function run() {
image: `${window.location.origin}/__tests__/browser/sources/shape_logo.png`
}
},
visible: guiObject.visible,
clipInRange: false
// limitRect: {
// x: 50,
Expand Down Expand Up @@ -195,6 +198,9 @@ export function run() {
})
);
});
gui.add(guiObject, 'visible').onChange(value => {
markPoints.forEach(markPoint => markPoint.setAttribute('visible', value, true));
});

gui.add(guiObject, 'itemOffsetX').onChange(value => {
markPoints.forEach(markPoint =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ describe('Marker', () => {
expect((markPointContainer.children[0] as unknown as Segment).startSymbol?.attribute.y).toBe(250);

// tag构造的label
expect((markPointContainer.children[2] as unknown as Tag).attribute.x).toBeCloseTo(209.5782628522115);
expect((markPointContainer.children[2] as unknown as Tag).attribute.y).toBeCloseTo(282.87347885566345);
expect((markPointContainer.children[2] as unknown as Tag).attribute.x).toBeCloseTo(210);
expect((markPointContainer.children[2] as unknown as Tag).attribute.y).toBeCloseTo(280);
expect(
((markPointContainer.children[2] as unknown as Tag).getChildByName('tag-content') as any).children[0].attribute
.text
Expand Down
Loading

0 comments on commit 9c48956

Please sign in to comment.