Creating a custom d3 layout

后端 未结 1 596
借酒劲吻你
借酒劲吻你 2021-02-07 20:17

I need to create a custom d3 layout that is somewhat close to a treemap but in a triangular style. Here\'s a screenshot so that you can understand:

1条回答
  •  孤城傲影
    2021-02-07 21:06

    Just copy and paste the d3.layout.pyramid function into a new file and rename functions as necessary so it doesn't conflict with the d3 library. Likely everything will be private so only the outermost function will need to be renamed. You probably won't have to namespace it to "d3". That is to say, this should work:

    var myPyramidLayout = function () {
        ...
    }
    

    0 讨论(0)
提交回复
热议问题