Published
Edited
Oct 31, 2020
1 fork
2 stars
Insert cell
Insert cell
width
Insert cell
groupSexViz = {
// Observable specific code
var cont = html`
<div style="display:inline-block;width:410px;margin-left:${width/2-400/2}px;height:350px">
</div>`;
yield cont;
// General pie chart invokation code
new PieChart()
.data(groupSexCount)
.container(cont)
.groupingText('სულ რაოდ.')
.percentCircleRadius(18)
.round((d,sum)=>Math.round(d.data.value/sum*100*10)/10)
.centerText('განაწილება სქესით')
.render();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
toCount = (g)=> {
g.value = g.values.length;
return g;
}
Insert cell
groupSexCount = wrangled.filter(d=>d.key=="sex")[0].group.map(toCount).map((d,i)=>{
return Object.assign(d,{color:['#24A4CF','#B33272','#A7B4C0'][i]})
})
Insert cell
Insert cell
import {PieChart} from "433526db1488ee11"
Insert cell
d3 = require('d3@v6')
Insert cell
import {load} from "@bumbeishvili/fetcher"
Insert cell
import {wrangle} from "@bumbeishvili/utils"
Insert cell
dataLoad = load('https://docs.google.com/spreadsheets/d/1e90NSA8pBIAoT7hOgIsemLUzPt-dYeNs-nuOK1Za9sI/edit#gid=425145875')
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