Skip to main content

harry palmer

harry palmer's Public Library

  • row-fluid need the style attribute " white-space: nowrap; " and the divs inside need the style attribute " display: inline-block; "

    .row-fluid{      white-space: nowrap; } .row-fluid .col-lg-3{      display: inline-block; }

  • Just for clarity, I'll point out that this is exactly the behavior to expect based on the documentation at


    Specifically, if we go into a console and do some experimentation, we'll see that the values "A" and 1 don't behave properly with respect to the Javascript inequality operators. "A" < 1 is false, "A" > 1 is false, and "A" == 1 is false. That's not a consistent result. However, in the case of strings "A" < "1" is false, "A" > "1" is true, and "A" == "1" is false. That's consistent, which is why it works. Meanwhile, null < null is false, null > null is false, and null === null is true. That's consistent, meaning we should properly see a null group.


    In general, the rule of thumb is that if you are not confident that all of your data will have a predictable dimension value (and really, are we ever confident of this?), then you need to coerce your dimension accessor return value like so:

    var stringDim = xfilter.dimension(function(d) { return "" + d.value; }); var numDim = xfilter.dimension(function(d) { return +d.value; }); var boolDim = xfilter.dimension(function(d) { return d ? true : false; }); 

    If we do this, we should never run into this problem. I've gotten tripped up by this plenty of times, but have managed to teach myself that I've always always got to coerce types like this. But Crossfilter can't really do it for us because there is no way for Crossfilter to know what data type the dimension should have. I'm thinking about how I might be able to add something like this to the Reductio API.

  • up vote  3  down vote     accepted  

    In Crossfilter you can query dimensions (e.g. or groups (e.g. group.all() or Queries on a dimension return your original data records in the ordering of the dimension and they respect all filters in place on the Crossfilter including the filter on that dimension, if any. Queries on groups return your group aggregations and respect filters in place on the Crossfilter except the filter on the dimension the group is defined on.


    The reason for this design is that you will use the result of group queries to build interactive types of charts (that is, charts the user will filter on) because we want to chart aggregated values. When the user is filtering on a chart, you really don't want that chart to change. The data should hold still for the user. All the other charts (based on groups defined on other dimensions) should change. So that's the reason that groups ignore filters on their own dimension.


    The dataTable example you reference works for the following reason: dc.js generally uses the group it is passed to build its chart using or group.all methods to get data, which ignores the filter on the dimension of that group. The dimension passed to a chart is usually only used for applying filters from that chart. It is usually (though doesn't have to be) the dimension the group in the same chart was defined on. The dc.js dataTable is different. It uses the dimension to get the data it requires. Because of this, as noted above, the dataTable will show you data that respects all filters on the Crossfilter, including any filters in place on the dimension used in the dataTable.

Aug 22, 16

"up vote
down vote
I'm trying to using bootstrap's columns and the combined total is 24. Now I know after a combined total of 12 it breaks to a line, but is there a way to keep it on the same line and just use a horizontal scroll bar to view the rest? this is what I have in the view:"

  • import json import re  nonspace = re.compile(r'\S') def iterparse(j):  decoder = json.JSONDecoder()  pos = 0  while True:  matched =, pos)  if not matched:  break  pos = matched.start()  decoded, pos = decoder.raw_decode(j, pos)  yield decoded  rawdata = '{"Len":"0000000000000376"}{"PipeType":2}' for decoded in iterparse(rawdata):  print(decoded)

  • In the absence of a way to attach the callback once globally, one thing you could do to mitigate the risk from duplicate code is to define the callback function once and pass in a reference instead of defining it inline on each chart.

    function my_func() {     // do stuff }  dc.pieChart(myDomId2)     .dimension(dimBeta)     .group(groupBeta)     .on("filtered", my_func);

  • up vote  1  down vote   favorite 

    I have this below data.


    Any possibilites i can create one using dc.js?


    Can someone help me in creating a histogram using dc js?


    Searched all over the forum but couldn't get something useful except this post.


    Date :

Aug 01, 16

up vote
down vote
On the DC.js github, Stock Market Selection Strategy by Lon Riesberg is listed as an example of using the dc.js library.

He was able to color code the rows, as shown in the image below, which I'm trying to mimic."

  • Let me just say that such promises are given to make people think that they will win at least $10,000, even if the software does not work for them. And usually such promises are empty as they come. Once you register and fund your trading account, nothing guarantees that you will be given this money.


    The words of a paid actor with no last name (exactly like the random Jake, supposedly the creator of the Greenwood Formula software) do not have any legal power. I say that this is just another lie to lure people into signing up with Green Wood Formula binary options robot.

  • Amazon Drive


    Paths are specified as remote:path


    Paths may be as deep as required, eg remote:directory/subdirectory.


    The initial setup for Amazon Drive involves getting a token from Amazon which you need to do in your browser. rclone config walks you through it.


    Here is an example of how to make a remote called remote. First run:


    • <form onsubmit="return post_form(this, 'editusertext')" id="form-t3_3pbwa9vlw" action="#" class="usertext warn-on-unload">

      Need some advice on this one. About 150GB of data needs secure online storage.


      It seems Duplicity with gpg key is the most useful solution for local encryption. Opinions on this?


      The question right now is whether to use Dropbox or Spideroak to store the encrypted data.


      Dropbox does not provide privacy, but with the local encryption this should not matter? Spideroak provide privacy and encryption but can only be safely accessed with the desktop application.


      Using Dropbox with a folder for the encrypted data (the 150GB), the rest of the storage could be used for non-sensitive data with mobile devices etc. With no access to the encrypted data when not desired.


      With Spideroak, the option for mobile connection (or use for non-sensitive data) is limited to desktop connection.


      What is your opinion on this? Any advice or alternative solutions?


      Thank you for your time.


  • The problem here is that you created a custom count of versions less than 2 and plotted that in your bar chart. Crossfilter has no idea what that refers to in the reverse direction. Thus when you click on the second chart in area 'b' crossfilter applies .filter("b") to that dimension and then the crossfilter object. Thus your output is correct. To do what you want to do I would recommend adding a new dimension

    var versionDim = ndx.dimension(function(d) {return d.version}); 

    and then add an onfiltered listener to your second chart This listener checks to see if you tried to filter your second chart and if so applies a filter on the new dimension i created above.

    .on("filtered", function(chart){     if( < ndx.size())     {         versionDim.filter(1);     }else{     versionDim.filterAll();     } }) 

  • “Should I use Infinite scrolling or Pagination for my content?” Some designers are still refereeing a tug-o-war between the two methods to decide which to implement into their projects. Each of them has their strengths and weaknesses and in this article we’ll overview the two methods and decide which one we should use for our projects.

  • I built a crossfilter with several dimensions and groups to display the data visually using dc.js. The data visualized is bike trip data, and each trip will be loaded in. Right now, there's over 750,000 pieces of data. The JSON file I'm using is 70 mb large, and will only need to grow as I receive more data in the months to come.


    So my question is, how can I make the data more lean so it can scale well? Right now it is taking approximately 15 seconds to load on my internet connection, but I'm worried that it will take too long once I have too much data. Also, I've tried (unsuccessfully) to get a progress bar/spinner to display while the data loads, but I'm unsuccessful.


    The columns I need for the data are start_date, start_time, usertype, gender, tripduration, meters, age. I have shortened these fields in my JSON to start_date, start_time, u, g, dur, m, age so the file is smaller. On the crossfilter there is a line chart at the top showing the total # of trips per day. Below that there are row charts for the day of week (calculated from the data), month (also calculated), and pie charts for usertype, gender, and age. Below that there are two bar charts for the start_time (rounded down to the hour) and tripduration (rounded up to the minute).


    The project is on GitHub: (the dataset is in data2.json). I tried to create a jsfiddle but it is not working (likely due to the data, even gathering only 1,000 rows and loading it into the HTML with <pre> tags):


    Ideally it would function so that only the data for the top chart would load in first: this would load quickly since it's just a count of data by day. However, once it gets down into the other charts it needs progressively more data to drill down into finer details. Any ideas on how to get this to function?

  •   7  down vote     accepted  

    I'd recommend shortening all of your field names in the JSON to 1 character (including "start_date" and "start_time"). That should help a little bit. Also, make sure that compression is turned on on your server. That way the data sent to the browser will be automatically compressed in transit, which should speed things up a ton if it's not already turned on.


    For better responsiveness, I'd also recommend first setting up your Crossfilter (empty), all your dimensions and groups, and all your dc.js charts, then using Crossfilter.add() to add more data into your Crossfilter in chunks. The easiest way to do this is to divide your data up into bite-sized chunks (a few MBs each) and load them serially. So if you are using d3.json, then start the next file load in the callback of the previous file load. This results in a bunch of nested callbacks, which is a bit nasty, but should allow the user interface to be responsive while the data is loading.


    Lastly, with this much data I believe you will start running into performance issues in the browser, not just while loading the data. I suspect you are already seeing this and that the 15 second pause you are seeing is at least partially in the browser. You can check by profiling in your browser's developer tools. To address this, you'll want to profile and identify performance bottlenecks, then try to optimize those. Also - be sure to test on slower computers if they are in your audience.

  • No — if you'd like to have for example a multi-bar chart showing 200m+ bars.

    Maybe — if you have a suitable use case which does some pre-analysis and/or data transformation to reduce the load for d3.js. Have a look at this Crossfilter example, it works with "nearly a quarter-million flights". You could use ElasticSearch to store the data and do queries on data for the filtering/transformation.

  • Since many years I use an old trick I learned in some blog, I'm sorry i don't remember the name to give him credits.


    Anyway to center floating elements this should work:


    You need a structure like this:


        .main-container {       float: left;       position: relative;       left: 50%;     }     .fixer-container {       float: left;       position: relative;       left: -50%;     }
    <div class="main-container">   <div class="fixer-container">     <ul class="list-of-floating-elements">        <li class="floated">Floated element</li>       <li class="floated">Floated element</li>       <li class="floated">Floated element</li>      </ul>   </div> </div>
1 - 20 of 8702 Next › Last »
20 items/page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo