kennethkufluk / js-mindmap

JavaScript Mindmap
http://kenneth.kufluk.com/google/js-mindmap/
MIT License
605 stars 146 forks source link

Adjusting Raphael to get mindmap to fit in a DIV #11

Open b3ccio opened 13 years ago

b3ccio commented 13 years ago

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?

penyaskito commented 12 years ago

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

ghost commented 10 years ago

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!

swirlingskirts commented 10 years ago

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.