Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mystery of the disappearing pixels #166

Closed
andrewxhill opened this issue Apr 8, 2015 · 3 comments
Closed

Mystery of the disappearing pixels #166

andrewxhill opened this issue Apr 8, 2015 · 3 comments
Assignees
Milestone

Comments

@andrewxhill
Copy link
Contributor

ha

Watch the cluster of dots as they first draw. Notice the dot in the lower left of the cluster. It appears... then disappears!! I have mentioned this a number of times in the past but it still is there.

This is cumulative

Here is the map, https://team.cartodb.com/u/andrew/viz/bd7be8d8-de31-11e4-8c23-0e018d66dc29/embed_map

@andrewxhill
Copy link
Contributor Author

Likely related,

https://team.cartodb.com/u/andrew/viz/1fbc2928-de4f-11e4-bfb7-0e4fddd5de28/embed_map

should have plenty of points in the middle of america

screen shot 2015-04-08 at 8 25 04 pm

The difference is that in the second version I have this,

  marker-fill: blue;
  [value=3]{marker-fill: blue;}
  [value=1]{marker-fill: magenta;}
  [value=2]{marker-fill: aqua;}

Versus the non-working one which is this,

  [value=3]{marker-fill: blue;}
  [value=1]{marker-fill: magenta;}
  [value=2]{marker-fill: aqua;}

In the one that doens't work, I don't have a default color fill. Now, this doesn't make sense mathematically, so there probably is a hiccup someplace inside the library...

My data is from twitter, I only have a category of 1 or 2. My aggregation function is,

-torque-aggregation-function:"sum(distinct(category_name))";

You see, distinct can either be a 1, or a 2 or both! So the only possible values from my function (unless I'm tired) are, 1 (if they all happen to be 1) or 2 (if they all happen to be 2) or 3 (if some are 1 and some are 2). So there is no reason why my first set of rules shouldn't cover all values.

@andrewxhill
Copy link
Contributor Author

disa

it's very strange. i think this must be related. there is no reason a BLUE dot should ever turn back into an AQUA map. impossible given the rule, torque must be doing something wrong in the render

@fdansv
Copy link
Contributor

fdansv commented May 4, 2015

@andrewxhill ok I think I've figured it out. With torque-aggregation-function, you do control the way that values attached to points are aggregated. But you're not controlling the way in which those values accumulate over time, which is always by adding the new value to the previous one.

So here's, from your own example, a disappearing point:

{
    x__uint8: 36, 
    y__uint8: 5,
    vals__uint8: [
        2,
        2
    ],
    dates__uint16: [
        23,
        45
    ]
}

In accumulative mode, at step 45, torque is adding the new value (2), to the previous value being displayed (again, 2), which will render a value of 4. Now if you take a look at the CartoCSS:

/** torque visualization */ Map {
    -torque-frame-count:256;
    -torque-animation-duration:20;
    -torque-time-attribute:"postedtime";
    -torque-aggregation-function:"sum(distinct(category_name))";
    -torque-resolution:2;
    -torque-data-aggregation:cumulative;
}
#ncaa_finals_game_tweets{
    comp-op: multiply;
    marker-fill-opacity: 0.6;
    marker-line-color: #FFF;
    marker-line-width: 0;
    marker-line-opacity: 0;
    marker-type: ellipse;
    marker-width: 6;
    [value>=3]{
        marker-fill: blue;
    }
    [value=1]{
        marker-fill: magenta;
    }
    [value=2]{
        marker-fill: aqua;
    }
}

... you'll see that there is no colour specified for values higher than 3, or a default marker colour for that matter. By changing the blue rule to [value=3]{ instead of just equal, the points stop disappearing:

dis

cc @javisantana I think this is a non-issue, but definitely writing up the more formal specification of the torque format should clear these kind of things up :)

@fdansv fdansv closed this as completed May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants