Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 78: | Line 78: | ||
const FN_ANALYSIS = 'Analysis'; | const FN_ANALYSIS = 'Analysis'; | ||
const FN_METRICS = 'Metrics'; | const FN_METRICS = 'Metrics'; | ||
const FN_REPORT = 'Report'; | |||
const getUrl = title => title ? '/index.php/Special:FilePath/' + title : title; | const getUrl = title => title ? '/index.php/Special:FilePath/' + title : title; | ||
Line 132: | Line 133: | ||
'Audience metrics', | 'Audience metrics', | ||
'Competitor metrics' | 'Competitor metrics' | ||
]; | |||
const reportFunctions = [ | |||
'Filtering sorting searching', | |||
'Clustering Aggregation', | |||
'Visualization options', | |||
'PDF export' | |||
]; | ]; | ||
Line 141: | Line 148: | ||
postFunctions.map(func => '|?' + func).join('') + | postFunctions.map(func => '|?' + func).join('') + | ||
analysisFunctions.map(func => '|?' + func).join('') + | analysisFunctions.map(func => '|?' + func).join('') + | ||
metricsFunctions.map(func => '|?' + func).join('') | metricsFunctions.map(func => '|?' + func).join('') + | ||
; | reportFunctions.map(func => '|?' + func).join(''); | ||
const dctQueryUrl = '/api.php?action=ask&format=json&query=' + encodeURIComponent(dctQuery); | const dctQueryUrl = '/api.php?action=ask&format=json&query=' + encodeURIComponent(dctQuery); | ||
const dctResponse = await fetch(dctQueryUrl).then(response => response.json()); | const dctResponse = await fetch(dctQueryUrl).then(response => response.json()); | ||
Line 163: | Line 170: | ||
if (hasFunction(dctResult, analysisFunctions)) dct.functions.push(FN_ANALYSIS); | if (hasFunction(dctResult, analysisFunctions)) dct.functions.push(FN_ANALYSIS); | ||
if (hasFunction(dctResult, metricsFunctions)) dct.functions.push(FN_METRICS); | if (hasFunction(dctResult, metricsFunctions)) dct.functions.push(FN_METRICS); | ||
if (hasFunction(dctResult, reportFunctions)) dct.functions.push(FN_REPORT); | |||
return dct; | return dct; |
Revision as of 16:13, 9 June 2022
Development verstion of the DCT List.
Not ready for production!