up convert sms
This commit is contained in:
parent
4fd1a64015
commit
f3d062092f
2
Makefile
2
Makefile
|
@ -8,7 +8,7 @@ convert:
|
||||||
bash ./scripts/concat_org.sh
|
bash ./scripts/concat_org.sh
|
||||||
mv all_tasks.org sources/
|
mv all_tasks.org sources/
|
||||||
node parse_orgmode_to_json.mjs
|
node parse_orgmode_to_json.mjs
|
||||||
ts-node render_chart.mjs
|
ts-node render_chart.ts
|
||||||
start:
|
start:
|
||||||
npm start
|
npm start
|
||||||
copyTasksJson :
|
copyTasksJson :
|
||||||
|
|
|
@ -11,10 +11,10 @@ const chartType = 'line'
|
||||||
|
|
||||||
// time in : weeks, months, years, days
|
// time in : weeks, months, years, days
|
||||||
|
|
||||||
// const time_agreggate = 'days'
|
const time_agreggate = 'days'
|
||||||
// const time_agreggate = 'weeks'
|
// const time_agreggate = 'weeks'
|
||||||
// const time_agreggate = 'months'
|
// const time_agreggate = 'months'
|
||||||
const time_agreggate = 'years'
|
// const time_agreggate = 'years'
|
||||||
function convertStats(tasks: any) {
|
function convertStats(tasks: any) {
|
||||||
let converted = []
|
let converted = []
|
||||||
let weeks = Object.keys(tasks['statistics']['statistics']['dates'][time_agreggate]);
|
let weeks = Object.keys(tasks['statistics']['statistics']['dates'][time_agreggate]);
|
||||||
|
|
|
@ -53,7 +53,7 @@ function convertToCsv (elementsArray) {
|
||||||
*/
|
*/
|
||||||
function convertJsonToCsvAndPersistTSVFile (jsonFilePath, outputFileTSVName) {
|
function convertJsonToCsvAndPersistTSVFile (jsonFilePath, outputFileTSVName) {
|
||||||
|
|
||||||
console.log('convert', folder_base+'output/' + jsonFilePath)
|
console.log('convertJsonToCsvAndPersistTSVFile ', folder_base+'output/' + jsonFilePath)
|
||||||
fs.readFile(folder_base+'output/' + jsonFilePath, 'utf8', function (err, data) {
|
fs.readFile(folder_base+'output/' + jsonFilePath, 'utf8', function (err, data) {
|
||||||
data = JSON.parse(data)
|
data = JSON.parse(data)
|
||||||
console.log('data', data.length)
|
console.log('data', data.length)
|
||||||
|
|
|
@ -17,7 +17,7 @@ const outputAbsolutePath = '/home/tykayn/Nextcloud/ressources/social sorting/out
|
||||||
|
|
||||||
export async function writeFileInOuputFolderFromJsonObject (fileName, jsonObjectThing) {
|
export async function writeFileInOuputFolderFromJsonObject (fileName, jsonObjectThing) {
|
||||||
|
|
||||||
// console.log('statistics.dates', statistics.dates)
|
console.log('writeFileInOuputFolderFromJsonObject', fileName)
|
||||||
let fullpath = `${outputAbsolutePath}${fileName}`
|
let fullpath = `${outputAbsolutePath}${fileName}`
|
||||||
|
|
||||||
return await fs.writeFileSync(
|
return await fs.writeFileSync(
|
||||||
|
|
Loading…
Reference in New Issue