【问题标题】:Cubism.JS threshold scale doesn't workCubism.JS 阈值比例不起作用
【发布时间】:2013-07-23 23:37:47
【问题描述】:

我正在使用来自石墨的数据的立体派

数据的域是连续的 [0,100],范围是连续的 [0,100],但任何低于 100 的都是无稽之谈,所以我修改了比例并使用了阈值比例,以便:

var scale = d3.scale.threshold().domain([100]).range([0,100])

console.log(scale(1)) //returns 0
console.log(scale(99.9)) //returns 0
console.log(scale(88.9)) //returns 0
console.log(scale(100)) //returns 100

当我应用它时,整个图表都变空了

.call(context.horizon().height(100)
    .colors(colors)
    .scale(d3.scale.threshold().domain([100]).range([0,100])) // range([0,1]) doesn't work either
);

不应用比例(注意白色的小区域)

    .call(context.horizon().height(100)
    .colors(colors)
    // .scale(d3.scale.threshold().domain([100]).range([0,100])) // range([0,1]) doesn't work either
);

【问题讨论】:

    标签: cubism.js


    【解决方案1】:

    缩放不起作用,所以我使用了石墨的功能

    我特别用过

    removeAboveValue(keepLastValue(xxx),99.99999)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-08
      • 2010-11-13
      • 1970-01-01
      • 1970-01-01
      • 2014-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多