hizzgdev / jsmind

a mind mapping library built by javascript
http://hizzgdev.github.io/jsmind/
Other
3.48k stars 871 forks source link

Feature discussion: zoom in / zoom out #48

Closed godiard closed 8 years ago

godiard commented 8 years ago

Hi, I would like implement a zoom in/zoom out feature. One alternative is change the font size in the nodes (with the limitation that do not change the image nodes size).

As a experiment, I added the following method in features_2.html and works

    function zoom_out() {
        var localCss = document.getElementById('localStyle');
        if (localCss == null) {
            localCss = document.createElement('style');
            localCss.id = 'localStyle';
            localCss.title = 'localStyle';
            localCss.type = 'text/css';
            localCss.innerHTML = "jmnode {font:10px Arial !important}";
            document.head.appendChild(localCss);
        }
        _jm.show(_jm.get_data());
    }

Obviously a real solution is more complex, we need define the default font size, and increase/decrese the size, and/or other values, this is just a proof of concept.

Before start to code this, I would like to know if is a feature that would be accepted, and if this approach looks right.

hizzgdev commented 8 years ago

This is a very useful feature, and it will be accepted. but there are more details need to deal with: lines on canvas, node editing, scrollbars or pan, size of jmexpander.

look forward for your new pr, thank you very much.

godiard commented 8 years ago

Sent a pull request with a alternative, simpler, implementation.

godiard commented 8 years ago

Please add hactoberfest label :)

https://hacktoberfest.digitalocean.com/

hizzgdev commented 8 years ago

thank @godiard

https://github.com/hizzgdev/jsmind/pull/54