[openspending-dev] Help to input the icons on WDMMG

Tryggvi Björgvinsson tryggvi.bjorgvinsson at okfn.org
Wed Feb 6 21:03:12 UTC 2013


Hi,

I'm not Friedrich but I have suggestion.

In your file around the place where you put your "money.svg" you put the
names as well.

For example you have 'DEBT SERVICE' and 'STATUTORY TRANSFERS'. These
need to be what we would call slugs meaning we change everything into
lowercase letters and whitespace into dashes: '-'

So:
'DEBT SERVICE' would become 'debt-service'
'STATUTORY TRANSFERS' would become 'statutory-transfers'
'CAPITAL SUPPLEMENTATION' would become 'capital-supplementation'
and so on.

Try to make these changes and let us know if it works or not.

/Tryggvi

Þann mið 6.feb 2013 18:01, skrifaði Володимир Харченко:
>
>
> Helo Friedrich!!! Sorry for my English! May have a hard time
> understanding. I have my own set of openspending.org/sumy13_v_col But I
> decided to set http://openspending.org/nigeriabudg13 I want to learn
> here. This is a simple standard set. I understand that the "from" - the
> highest level, "to" - the lowest level. All turns out well:
> http://imageshost.ru/photo/66429/id2786574.html But how to make different
> colors and icons for different level "from", and then "to"? On the
> Internet there are not examples in which import data is to openspending.
> "Uganda " there
> is(https://github.com/okfn/bubbletree/tree/master/demos/uganda , but
> there is taxonomy. I do not have .. Help. Change to my file that is wrong
> ... here Welcome Friedrich!!! Sorry for my English! May have a hard time
> understanding. I have my own set of openspending.org/sumy13_v_col But I
> decided to set http://openspending.org/nigeriabudg13 I want to learn
> here. This is a simple standard set. I understand that the "from" - the
> highest level, "to" - the lowest level. All turns out well:
> http://imageshost.ru/photo/66429/id2786574.html But how to make different
> colors and icons for different level "from", and then "to"? On the
> Internet there are not examples in which import data is to openspending.
> "Uganda " there
> is(https://github.com/okfn/bubbletree/tree/master/demos/uganda , but
> there is taxonomy. I do not have .. Help. Change to my file that is wrong
> ... here: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
> <head> <meta charset="UTF-8"/> <title>Uganda Budget</title> <script
> type="text/javascript" src="../../lib/jquery-1.5.2.min.js"></script>
> <script type="text/javascript"
> src="../../lib/jquery.history.js"></script> <script
> type="text/javascript" src="../../lib/jquery.tooltip.min.js"></script>
> <script type="text/javascript" src="../../lib/raphael.js"></script>
> <script type="text/javascript" src="../../lib/vis4.js"></script> <script
> type="text/javascript" src="../../lib/Tween.js"></script> <script
> type="text/javascript" src="../../build/bubbletree.js"></script> <script
> type="text/javascript"
> src="http://assets.openspending.org/openspendingjs/master/lib/aggregator.js"></script>
> <link rel="stylesheet" type="text/css" href="../../build/bubbletree.css"
> /> <style type="text/css"> #header { width: 300px; } </style> <script
> type="text/javascript"> $(function() { var $tooltip = $('<div
> class="tooltip">Tooltip</div>'); $('.bubble-chart').append($tooltip);
> $tooltip.hide(); var getTooltip = function() { return
> this.getAttribute('tooltip'); }; var initTooltip = function(node,
> domnode) { domnode.setAttribute('tooltip', node.label+'  <br
> /><big><b>'+node.famount+'</b></big>');
> vis4.log(domnode.getAttribute('tooltip')); $(domnode).tooltip({ delay:
> 200, bodyHandler: getTooltip }); }; new OpenSpending.Aggregator({ apiUrl:
> 'http://openspending.org/api', dataset: 'nigeriabudg13', drilldowns:
> ['from', 'to'], //cuts: ['year:2005', 'spending_type:Disbursement'], //
> localApiCache: 'aggregate.json', rootNodeLabel: '2013 Budget Proposal
> (Nigeria)', breakdown: 'to', callback: function(data) { new BubbleTree({
> data: data, container: '.bubbletree', //tooltipCallback: tooltip,
> bubbleType: ['icon'], initTooltip: initTooltip, maxNodesPerLevel: 12,
> bubbleStyles: { 'id': {  'root': { color: '#FF0000', icon: 'money.svg'}//
> yes }, 'name': {  'DEBT SERVICE': {color: '#1A439A', icon: 'money.svg'
> },// not 'STATUTORY TRANSFERS': {color: '#A1218D', icon: 'money.svg' },//
> not 'CAPITAL SUPPLEMENTATION': {color: '#1A439A', icon: 'money.svg'}//
> not } } }); } }); });
> </script> </head> <body> <div id="header"><a class="title">Nigeria in
> Uganda</a> <div class="subtitle"></div></div> <div
> class="bubbletree-wrapper"> <div class="bubbletree"></div> </div> </body>
> </html>
>
>>
>
>
> _______________________________________________
> openspending-dev mailing list
> openspending-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/openspending-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/openspending-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20130206/28f45a7d/attachment.html>


More information about the openspending-dev mailing list