[OpenSpending] Pagination of Bubble Tree
M.Skop KohoVolit.eu
michal.skop at kohovolit.eu
Sat May 12 22:02:07 UTC 2012
Hi,
I call it using ajax as this:
(the url is built by drupal in budovanistatu.cz case, but it is only the
.json file)
$(function() {
//before ajax call
$('#bubbletree-ajax-loader').html('<img
src=\"".drupal_get_path('module', 'bubbletree') . "/ajax-loader.gif\"
alt=\"Wait\" /> Nahrávám data rozpoc(tu, mu*z(e to chvíli trvat ...');
$.ajax({
url: '".drupal_get_path('module', 'bubbletree') . "/data" .
(isset($_GET['scope']) ? "b9" : "b12") . ".json',
dataType: 'json',
success: function (d) {
new BubbleTree({
data: d,
container: '.bubbletree',
maxNodesPerLevel: 15
});
},
});
});
I've made a few changes in the bubbletree.js file regarding the
'maxNodesPerLevel' function, not sure why now, but just in case:
A)
me.preprocessData = function(root) {
var me = this, maxNodes = config.maxNodesPerLevel;//**ms
instead of:
var me = this, maxNodes = me.config.maxNodesPerLevel;
if (maxNodes) {
B)
or (var i in root.children) {
if (i < maxNodes - 1) {
keep.push(root.children[i]);
instead of:
or (var i in root.children) {
if (i < maxNodes) {
keep.push(root.children[i]);
C)
moved (and changed) the line
me.preprocessData(root);
down towards:
me.preprocessData(node);
me.globalNodeCounter++;
Hope it helps
Michal
On 2012-05-11 11:16, Friedrich Lindenberg wrote:
> Hi Erdenebayar,
>
> just to follow up on the other discussion: I think that the bubble
> tree has the option of grouping small bubbles into a "More"
> pseudo-bubble but I can't recall how this was activated (and can't
> find it with a glance at the code).
>
> @Gregor: how does this happen?
>
> - Friedrich
>
> On Thursday, May 3, 2012 at 11:08 AM, Erdenebayar Erdenebileg wrote:
>
>> Hello ALL
>>
>> I'm trying to start using Bubble Tree of Open Spending.
>> I need to pagination bubbles. I have a more bubble, and it looks bad.
>> Or are there some configuration for that feature.
>>
>> Regards,
>> Erdenebayar
>> _______________________________________________
>> openspending mailing list
>> openspending at lists.okfn.org <mailto:openspending at lists.okfn.org>
>> http://lists.okfn.org/mailman/listinfo/openspending
>
>
>
> _______________________________________________
> openspending mailing list
> openspending at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/openspending
--
Mgr. Michal S(kop, Ph.D.
KohoVolit.eu
michal.skop at kohovolit.eu
+420 775 187 021 / +420 721 484 915
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending/attachments/20120513/0ad8e697/attachment.html>
More information about the openspending
mailing list