Skip to content

Commit

Permalink
docs: supplement optional parameters of insight mark
Browse files Browse the repository at this point in the history
  • Loading branch information
LAI-X committed Nov 20, 2023
1 parent 7023561 commit f895846
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
28 changes: 27 additions & 1 deletion site/examples/intelligent/insight/demo/insight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,35 @@ chart
.encode('y', 'close');

chart.line();
// 指定洞察类型为趋势

// Add insight marks
chart.insight({
// Specify to add marks of type 'trend'
insightType: 'trend',
// If the value of dimensions or measures is not specified, it will be obtained from the encode information by default.
dimensions: [{ fieldName: 'date' }],
measures: [{ fieldName: 'close', method: 'SUM' }],
options: {
// Filter out not significant insights
filterInsight: true,
// Verify whether the input meets the algorithm requirements
dataValidation: true,
// Adjust the significance test threshold
algorithmParameter: {
// Parameter for trend mark
trend: {
threshold: 0.05,
},
// Only if insightType is 'change_point', the content of parameter changePoint will take effect.
changePoint: {
threshold: 0.1,
},
},
// Generate Chinese spec
visualizationOptions: {
lang: 'zh-CN',
},
},
});

chart.render();
4 changes: 2 additions & 2 deletions site/examples/intelligent/insight/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"filename": "insight.ts",
"title": {
"zh": "洞察标注",
"en": "Insight marks"
"zh": "洞察标注算法的详细参数",
"en": "Detailed Parameters of Insight Mark"
},
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*DweUTbVAaIEAAAAAAAAAAAAADmJ7AQ/original"
},
Expand Down

0 comments on commit f895846

Please sign in to comment.