Published unlisted
Edited
Jan 7, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
aq.from(pj).join( aq.from(altpj) , "time")
.derive({ ["avg_"+"Sociality_A"] : d => (d.Sociality_A_1+d.Sociality_A_2)/2 })
.derive({ ["avg_"+"Sociality_B"] : d => (d.Sociality_B_1+d.Sociality_B_2)/2 })
.select('time', 'Sociality_A_1', 'Sociality_A_2', 'Sociality_B_1', 'Sociality_B_2',
"avg_"+"Sociality_A", "avg_"+"Sociality_B")
.view(10)
Insert cell
Insert cell
Insert cell
endpointURL = 'https://argos.benetou.fr/v2/' // 'https://localhost/'
Insert cell
Insert cell
jobRefresh = 1000
Insert cell
Insert cell
Insert cell
delayOnIdle = 100
Insert cell
maxlength = 50000
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mid2 = "_s-"
Insert cell
Insert cell
Insert cell
Insert cell
defaultVisualization = data => Plot.plot({
y: {
grid: true,
domain: [0,1]
},
marks: [
Plot.line(data, {x: "time", y: columnNames[5], stroke: "green"}),
Plot.line(data, {x: "time", y: columnNames[6], stroke: "red"})
/*
0: "time"
1: "Interactions_A"
2: "Interactions_B"
3: "MNG_played_A"
4: "MNG_played_B"
5: "Sociality_A"
6: "Sociality_B"
7: "Items_in_Nest_0"
8: "Items_in_Nest_1"
*/
]
})
Insert cell
Insert cell
Insert cell
t2r = source => croppedRawArrayToFormattedRes( textToArrayThenRemoveTopLast( source ) )
Insert cell
textToArrayThenRemoveTopLast = text => text.split('\n').slice(1).slice(0, -1)
Insert cell
croppedRawArrayToFormattedRes = rawarray => rawarray.map( i => {
let d = i.split("\t");
let item = {}
d.map( (e,idx) => { item[columnNames[idx]] = Number(e); })
return item
} )
Insert cell
fetch(endpointURL).then(res => res.json())
Insert cell
Insert cell
columnNames = simul.split('\n')[0].split('\t')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
exampleOfDataLength = Number(await fetch(endpointURL+'data/'+job, {method: 'HEAD'}).then(res => res.headers.get("content-length")) )
// could check also status e.g 304 not modified versus 200
Insert cell
Insert cell
exampleOfDataSatus = Number(await fetch(endpointURL+'data/'+job, {method: 'HEAD'}).then(res => res.status ))
Insert cell
Insert cell
fetch(endpointURL+'data/'+job)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fetch(endpointURL + 'directxml', {
method: 'post',
body: JSON.stringify({xml: xmlToSubmit})
}).then(res => res.json())
Insert cell
Insert cell
fetch(endpointURL).then(res => res.json())
Insert cell
Insert cell
Insert cell
Insert cell
md`Usage stats https://dockprom.grafana.benetou.fr/d/U-ji9QM7z/docker-containers-argus?orgId=1&refresh=10s&from=1628396645506&to=1628569445506 `
Insert cell
FileAttachment("photo5810189160999401799.jpg").image()
Insert cell
md`Docker image https://github.com/Utopiah/remoteselfdom/blob/master/Dockerfile build time per layer https://observablehq.com/@utopiah/visualization-docker-image-build-time-per-layer`
Insert cell
md`ant SVG source https://freesvg.org/ant-silhouette-clip-art-1581585663 `
Insert cell
antSVG = FileAttachment("1581585663ants-insects-freesvg.org.svg").image()
Insert cell
antSVG.style = "transform: scale(0.1) rotate(25deg);"
Insert cell
html`
<style>
@keyframes slidein {
from {
margin-left: 10%;
}
to {
margin-left: -10%;
}
}
</style>

<span style="
animation-direction: alternate;
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: infinite;">
${antSVG}
</span>
`
Insert cell
Insert cell
Insert cell
See SSE for instant feedback via e.g https://observablehq.com/d/bb29b94606d32b64
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more