syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

when using dimensions() #335

Open aravindGear4 opened 7 years ago

aravindGear4 commented 7 years ago

Fllowing is my create and update code for my parallel coordinates.

function updateParallelCordsEvents(data){
var dimensions={
    "region_txt":{"title":"Region", "orient":"left", "type":"string"},
    "nperps":{"title":"Perpetrators","orient":"left","type":"number"},
    "weaptype1_txt":{"title":"Weapon", "orient":"left", "type":"string"},
    "nkillter":{"title":"Prep. Killed", "orient":"left","type":"number"},
    "nkill":{"title":"Killed","orient":"left","type":"number"},
    "nwound":{"title":"Wounded", "orient":"left", "type":"number"},
    "attacktype1_txt":{"title":"Attack Type", "orient":"left", "type":"number"},
    "targtype1_txt":{"title":"Target","orient":"right", "type":"string"},
};

if(gtdParacords){
      try{
          gtdParacords.removeAxes();
          gtdParacords.brushReset();
          gtdParacords.render();
      } catch(err){
          console.log("Ignored:"+err);
      }
  }
    var mode="queue";
    if(data.length<100 || !($('#isQueuing').is(':checked'))){
        mode="default";
    }
  gtdParacords = d3.parcoords()("#gtdParacords").composite("darker")
      .data(data).dimensions(dimensions).hideAxis(hideAxes)
    .mode(mode).color(function(d){
      return getEntityColor(d[category]);
    }).margin(marigin)//.smoothness(.2)
    .render().shadows().createAxes().brushMode("1D-axes-multi").on("brush",processSelected)
    .reorderable().interactive(); // command line mode
}

I want to orient my labels for axes, so I use .dimensions(dimensions) but I do not want to specify scale myself in this. So I use detectDimensions() but when I use both, scaling is not working working properly

After first Update:

<img width="682" alt="without detect dimesion" src="https://cloud.githubusercontent.com/assets/21281526/24842223/49c23b32-1d49-11e7-9589-1cd31f1d4286.PNG">

For the first time it is plotting correctly but when i update it, it still remain the old scale.

Thank You, Aravind.

aravindGear4 commented 7 years ago

I got around this issue by doing the following, I know it is not correct but this is what I did:


line 259:
-    if (!__.dimensions[k].yscale){
+    if (true){//!__.dimensions[k].yscale - quick fix for scalling issue