mirror of
https://github.com/lana-k/sqliteviz.git
synced 2026-08-05 07:19:17 +08:00
34 lines
850 B
JavaScript
34 lines
850 B
JavaScript
export default {
|
|
_migrate(installedVersion, inquiries) {
|
|
if (installedVersion < 2) {
|
|
inquiries.forEach(inquiry => {
|
|
inquiry.viewType = 'chart'
|
|
inquiry.viewOptions = inquiry.chart
|
|
delete inquiry.chart
|
|
})
|
|
}
|
|
|
|
if (installedVersion < 3) {
|
|
inquiries.forEach(inquiry => {
|
|
if (inquiry.viewType === 'graph') {
|
|
inquiry.viewOptions.style.nodes.color.opacity = 100
|
|
inquiry.viewOptions.style.highlightMode = 'node_and_neighbors'
|
|
}
|
|
})
|
|
}
|
|
|
|
if (installedVersion < 4) {
|
|
inquiries.forEach(inquiry => {
|
|
if (
|
|
inquiry.viewType === 'graph' &&
|
|
inquiry.viewOptions.layout.type === 'forceAtlas2'
|
|
) {
|
|
inquiry.viewOptions.layout.options.initialAlgorithm = 'circular'
|
|
}
|
|
})
|
|
}
|
|
|
|
return inquiries
|
|
}
|
|
}
|