js-mindmap icon indicating copy to clipboard operation
js-mindmap copied to clipboard

Adjusting Raphael to get mindmap to fit in a DIV

Open b3ccio opened this issue 13 years ago • 3 comments

More of a question than issue, but is there an easy way to adjust Raphael to have the mindmap fit inside a DIV instead of using the body tag?

b3ccio avatar Sep 23 '11 18:09 b3ccio

Change Raphael(0, 0, options.mapArea.x,options.mapArea.y) to Raphael('divID',options.mapArea.x,options.mapArea.y).

penyaskito avatar Jun 09 '12 04:06 penyaskito

I tried to make a wordpress plugin out of your awesome code, so I also have to put the mindmap in a div-container (#js-mindmap). Your advise worked nearly, but nevertheless all anchor elements are put into body element, so the mindmap always overlaps all other content.

<body>
    <a>1</a>
    <a>2</a>
    <a>3</a>
    <div id="js-mindmap"></div>
</body>

Is there a workaround? So the anchor elements will be put into my div container?

<body>
    <div id="js-mindmap">
        <a>1</a>
        <a>2</a>
        <a>3</a>
    </div>
</body>

Thanks in advance!

ghost avatar Jul 25 '14 11:07 ghost

I had this same issue. I'll try to clean up my solution enough to be worthy of adding to the js-mindmap project for others to take advantage of. It proved tricksier than just updating the line for Raphael.

swirlingskirts avatar Sep 15 '14 18:09 swirlingskirts