Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: support detailPath when pick vchart\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function renderChart(chart: Chart) {
const formatResult = table.options.specFormat(chart.attribute.spec, chartInstance, chart);
if (formatResult.needFormatSpec && formatResult.spec) {
const spec = formatResult.spec;
chartInstance.updateSpecSync(spec);
chartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });
updateSpec = formatResult.updateSpec ?? true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class DefaultCanvasChartRender extends BaseRender<Chart> implements IGrap
const formatResult = table.options.specFormat(chart.attribute.spec, activeChartInstance, chart);
if (formatResult.needFormatSpec && formatResult.spec) {
const spec = formatResult.spec;
activeChartInstance.updateSpecSync(spec);
activeChartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });
// return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@ export class VChartPicker implements IGraphicPicker {
numberType: number = CHART_NUMBER_TYPE;

contains(chart: any, point: any, params?: IPickParams): boolean | any {
if (!chart.AABBBounds.containsPoint(point)) {
const vChart = (chart as VChartGraphic).activeChartInstance;
if (!vChart) {
return false;
}
return true;
// 得到 vchart stage
const vchartStage = vChart.getStage();
vchartStage.dirtyBounds?.clear();
// 因为vchart 在 vtable 内始坐标变换始终等于在group中的坐标变换,所以这里不需要再做坐标转换
const pick = vchartStage.pick(point.x, point.y);
// @ts-ignore
if (pick.graphic === null && pick.group.name === 'root') {
return false;
}
return pick;
}
}
Loading