Search code examples
d3.jscubism.js

Disappeared cubism.js rule


The default cubism.js rule only covers the current browser. Once you scroll the browser down the rule (line) ends. Anyway to extend that besides resorting to javascript?


Solution

  • In cubism.js It used the following to control the style of the line (rule)

    function cubism_ruleStyle(line) {
      line
        .style("position", "absolute")
        .style("top", 0)
        .style("bottom", 0)
        .style("width", "1px")
        .style("pointer-events", "none");
    }
    

    By change "absolute" to "fixed" now I have the line across the screen even after I scroll down the screen. Thanks to a similar question asked by tanya, center div in the middle of the screen - even when page is scrolled up/down