Public
Edited
Nov 30, 2023
1 fork
Insert cell
Insert cell
Insert cell
data = {
const resp = await fetch(`https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/${article_name}/daily/20130101/20240101`);
const json = await resp.json();
return json.items;
}
Insert cell
viewof days=engraft(this,{'inputs':{data},'program':{'toolName':'slot','modeName':'tool','subProgram':{'toolName':'map','inputProgram':{'toolName':'slot','modeName':'code','code':'IDdata000000','defaultCode':'','subPrograms':{}},'itemVar':{'id':'IDsphynx733759','label':'item'},'perItemProgram':{'toolName':'slot','modeName':'tool','subProgram':{'toolName':'notebook','cells':[{'var_':{'id':'IDbreadfruit427700','label':'B'},'program':{'toolName':'slot','modeName':'code','code':'IDsphynx733759.timestamp.match("(....)(..)(..)")','defaultCode':'','subPrograms':{}},'outputManualHeight':'infinity'},{'var_':{'id':'IDoffer263201','label':'A'},'program':{'toolName':'slot','modeName':'code','code':'new Date(IDpedestrian212846[1], IDpedestrian212846[2] - 1, IDpedestrian212846[3])','defaultCode':'IDsphynx733759','subPrograms':{}}},{'var_':{'id':'IDheadstand346542','label':'C'},'program':{'toolName':'slot','modeName':'code','code':'{...IDsphynx733759, timestamp: IDpedestrian212846}','defaultCode':'IDpedestrian212846','subPrograms':{}}}],'prevVarId':'IDpedestrian212846'},'defaultCode':'IDsphynx733759'}},'defaultCode':''}});
Insert cell
viewof viz=engraft(this,{'inputs':{days},'program':{'toolName':'slot','modeName':'tool','subProgram':{'toolName':'voyager','inputProgram':{'toolName':'slot','modeName':'code','code':'IDdays000000','defaultCode':'','subPrograms':{}},'spec':{'data':{'name':'source'},'mark':'point','encoding':{'x':{'field':'timestamp','type':'temporal','scale':{}},'y':{'field':'views','type':'quantitative','scale':{}}},'config':{'line':{'point':true},'scale':{'useUnaggregatedDomain':true}}}},'defaultCode':''}});
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more