提交 d267c520 编写于 作者: View Design's avatar View Design

Merge branch 'main' of gitcode.com:git_bot/ai-fe

...@@ -191,12 +191,24 @@ function handleFormatWebSource (source) { ...@@ -191,12 +191,24 @@ function handleFormatWebSource (source) {
return sources return sources
} }
function handleFormatReports (content) { function handleFormatReports (content) {
let start = '::ProseLineChart' let chartStart = '::ProseLineChart'
// todo
let tableStart = '::ProseDataTable'
let result = '' let result = ''
// ::ProseLineChart{title='xxx' :labels='[]' :data='[]'}
content.forEach(item => { content.forEach(item => {
const { title, data, columns } = item const { title, data, format } = item
let toStr = JSON.stringify({ title, data, columns }) if (format === 'timeline') {
result += `${start}{:data=${toStr}}` const labels = []
const datas = []
data.forEach(child => {
labels.push(child.date)
datas.push(child.stargazers)
})
result += `${chartStart}{title=${title} :labels=${JSON.stringify(labels)} :data=${JSON.stringify(datas)}}`
} else if ( format === 'table' ) {
result += `${tableStart}{:data=${JSON.stringify(data)}}`
}
}) })
return result return result
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册