mubot-server
Version:
A server for mubot
148 lines (142 loc) • 3.48 kB
JavaScript
// This is fucking disasterous.
// stop hack more read http://d3pie.org/#docs
// Fix this all soon.
const graphics = {
palette: new Rickshaw.Color.Palette({scheme: 'spectrum2000'}),
userpalette: new Rickshaw.Color.Palette({scheme: 'cool'}),
pie: {},
pieContent: []
}
function loadPieChart() {
// Our 'mobile' version.
if(window.outerWidth < 501) {
graphics.pie = new d3pie("pieChart", {
"header": {
"title": {
"fontSize": 24,
"font": "open sans"
},
"subtitle": {
"color": "#999999",
"fontSize": 12,
"font": "open sans"
},
"titleSubtitlePadding": 9
},
"footer": {
"text": "Approximated next payout (300k Bits)",
"color": "#020101",
"fontSize": 15,
"font": "exo",
"location": "bottom-center"
},
"size": {
"canvasHeight": 280,
"canvasWidth": 280,
"pieOuterRadius": "100%"
},
"data": {
"sortOrder": "value-desc",
"content": graphics.pieContent,
smallSegmentGrouping: {
enabled: true,
value: 3,
valueType: "percentage",
label: "other users",
},
},
"labels": {
"outer": {
"pieDistance": 0
},
"inner": {
"hideWhenLessThanPercentage": 3
},
"mainLabel": {
"color": "#5179ae",
"fontSize": 13
},
"percentage": {
"color": "#ffffff",
"fontSize": 11,
"decimalPlaces": 0
},
"value": {
"color": "#40c07f",
"fontSize": 11
},
"lines": {
"enabled": true
},
"truncation": {
"enabled": true,
"truncateLength": 12
}
},
"tooltips": {
"enabled": true,
"type": "placeholder",
"string": "{label}: {value}, {percentage}%",
"styles": {
"backgroundColor": "#d4d2d2"
}
},
"effects": {
"pullOutSegmentOnClick": {
"effect": "elastic",
"speed": 400,
"size": 12
}
},
"misc": {
"gradient": {
"enabled": true,
"percentage": 100
}
}
})
// Our desktop version.
} else {
graphics.pie = new d3pie("pieChart", {
"header": {
"title": { "text": "Approximated next payout (300k Bits)", "fontSize": 24, "font": "open sans" },
"subtitle": {
"text": "After each block is found your shares are automagically converted into Monero bits.",
"color": "#999999",
"fontSize": 12,
"font": "open sans",
"text-shadow": "none"
},
"titleSubtitlePadding": 9
},
"footer": { "color": "#999999", "fontSize": 10, "font": "open sans", "location": "bottom-left" },
"size": { "canvasWidth": 400, "pieOuterRadius": "70%" },
"data": {
"sortOrder": "value-desc",
"content": graphics.pieContent,
smallSegmentGrouping: {
enabled: true,
value: 3,
valueType: "percentage",
label: "other users",
// color: "#cccccc"
},
},
"labels": {
"outer": { "pieDistance": 10},
"inner": {"hideWhenLessThanPercentage": 3 },
"mainLabel": {"fontSize": 11 },
"percentage": { "color": "#ffffff", "decimalPlaces": 0 },
"value": { "color": "#adadad", "fontSize": 11 },
"lines": { "enabled": true },
"truncation": { "enabled": true }
},
"effects": {
"pullOutSegmentOnClick": {"effect": "linear","speed": 400,"size": 15}
},
"misc": {
"gradient": { "enabled": true, "percentage": 100 }
}
})
}
}